From 079b5f6275d3d5dc14768097a9545baa5be708f1 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Wed, 13 Dec 2017 11:30:15 +0100 Subject: [PATCH 1/2] remove dependencies, ask for installing webpack-cli when using the CLI --- bin/webpack.js | 18 +++++++++++++++++- package.json | 7 ++----- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/bin/webpack.js b/bin/webpack.js index c599d8df6..fc931dba1 100755 --- a/bin/webpack.js +++ b/bin/webpack.js @@ -1,3 +1,19 @@ #!/usr/bin/env node -require("webpack-cli"); +let webpackCliInstalled = false; +try { + require.resolve("webpack-cli"); + webpackCliInstalled = true; +} catch(e) { + webpackCliInstalled = false; +} + +if(webpackCliInstalled) { + require("webpack-cli"); // eslint-disable-line node/no-unpublished-require +} else { + console.error("The CLI moved into a separate package: webpack-cli."); + console.error("Please install 'webpack-cli' in addition to webpack itself to use the CLI."); + console.error("-> When using npm: npm install webpack-cli"); + console.error("-> When using yarn: yarn add webpack-cli"); + process.exitCode = 1; +} diff --git a/package.json b/package.json index da81907fe..4a1c4ae93 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,6 @@ "async": "^2.1.2", "enhanced-resolve": "4.0.0-beta.2", "eslint-scope": "^3.7.1", - "interpret": "^1.0.0", "loader-runner": "^2.3.0", "loader-utils": "^1.1.0", "memory-fs": "~0.4.1", @@ -19,13 +18,10 @@ "node-libs-browser": "^2.0.0", "schema-utils": "^0.4.2", "source-map": "^0.5.3", - "supports-color": "^4.2.1", "tapable": "^1.0.0-beta.5", "uglifyjs-webpack-plugin": "^1.1.1", "watchpack": "^1.4.0", - "webpack-cli": "^1.5.2", - "webpack-sources": "^1.0.1", - "yargs": "^8.0.2" + "webpack-sources": "^1.0.1" }, "license": "MIT", "devDependencies": { @@ -68,6 +64,7 @@ "url-loader": "~0.5.0", "val-loader": "^1.0.2", "vm-browserify": "~0.0.0", + "webpack-cli": "^1.5.2", "webpack-dev-middleware": "^1.9.0", "worker-loader": "^0.8.0" }, From 272a632ea7d3e8820f3f0cb075ae3e6b55701f37 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Wed, 13 Dec 2017 15:05:12 +0100 Subject: [PATCH 2/2] webpack-cli should be added as devDependency --- bin/webpack.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/webpack.js b/bin/webpack.js index fc931dba1..dfe8f475c 100755 --- a/bin/webpack.js +++ b/bin/webpack.js @@ -13,7 +13,7 @@ if(webpackCliInstalled) { } else { console.error("The CLI moved into a separate package: webpack-cli."); console.error("Please install 'webpack-cli' in addition to webpack itself to use the CLI."); - console.error("-> When using npm: npm install webpack-cli"); - console.error("-> When using yarn: yarn add webpack-cli"); + console.error("-> When using npm: npm install webpack-cli -D"); + console.error("-> When using yarn: yarn add webpack-cli -D"); process.exitCode = 1; }