This article turns from: 79403637
The CLI moved into a separate package:webpack-cli. Please install ' webpack-cli ' on addition to webpack itself the CLI. When using NPM:NPM install Webpack-cli-d, when using Yarn:yarn add webpack-cli-d
webpack4.0.1 installation problem, prompt:
The CLI moved into a separate package:webpack-cli. Please install ' webpack-cli ' on addition to webpack itself the CLI. When using NPM:NPM install Webpack-cli-d
When using Yarn:yarn add webpack-cli-d
Solution:
One, the WEBPACK-V version number does not come out
Tips:
The CLI moved into a separate package:webpack-cli. Please install ' webpack-cli ' on addition to webpack itself the CLI. When using NPM:NPM install Webpack-cli-d, when using Yarn:yarn add webpack-cli-d
It means that the CLI has been moved to a special package webpack-cli. Please install WEBPACK-CLI In addition to the Webpack itself using the CLI when using NPM, use NPM install webpack-cli-d installation. When using yarn, use yarn add webpack-cli-d to install.
Workaround: Global installation webpack-cli NPM install Webpack-cli-g
will be able to prompt the publication of this number.
Second, in the project directory to install the local webpack-cli-d
NPM Install webpack-cli-d
Third, in the project directory to install the local Webpack
NPM Install webpack-d
Four, must use the configuration file: Webpack.config.js
Do not use the Webpack command, such as: Webpack demo01.js bundle01.js, can no longer execute.
V. Changes in webpack.config.js files
Webpack.config.js in the configuration, no longer support module under the loaders, need to change loaders to rules.
This is the following:
Module: {rules: [//For the CSS file, the corresponding loader processing {test:/\.css$/, loader: "Style-loader!css-loa Der "}]}
[Turn]webpack4.0.1 installation problems and Webpack.config.js configuration changes