Hot replacement
Because we build engineering projects is not automated, to modify one line of code must be compiled, which is a very troublesome thing, we need to automate the compilation, this time you need to start the service, with webpack-dev-server plug-ins
webpack3 upgrade webpack4
VUE-cli -g install npm
VUE project name and the init webpack has been the default
cd project name
npm run dev (normal interface to indicate success) to view the version number of webpack package.json, the version upgrade is 3 to 4 npm install after you'll find webpack @ ^ 4 -D run after an error, so we have to be handled according to error contents, because webpack upgrade, that webpack-dev-server also need to upgrade to the latest npm install webpack-dev-server @ latest -D run error, suggesting you webpack-cli not installed cnpm install webpack-cli @ latest -D run newspaper html-webpack-plugin wrong cnpm install html-webpack-plugin @ latest -D run eslint-loader error cnpm install eslint-loader @ latest report -D run newspaper vue-loader error
CNPM install vue-loader @ Latest -D
CNPM install CSS-Loader @ Latest -D
CNPM install postcss @ Latest -D-Loader
Operation will be successful again
When packing back to find an error, because webpack.optimize.CommonsChunkPlugin No, look here , add the corresponding code in webpack.prod.conifg.js
the corresponding CommonsChunkPlugin commented
cnpm install extract-text-webpack- plugin @ next - D
If you have been reported this error
Global search minRemainingSize remove these lines of code
We will contenthash into hash search contenthash
This package was successful