Webpack 4.0 early adopters

Webpack 4.0 is said to be 68% - 98% faster after it was released, and it also supports no configuration files, so it looks awesome

So try a shot

webpack and webpack-cli separated

Now to execute the webpack command, the package webpack-cli must be installed globally

As for why, I won't explain much.

 

What does zero configuration mean?

Support two modes --- development and production

The default entry file under development is index.js under src, and the exit file is the main.js file under dist

"scripts": {
    "start": "webpack --mode development"
  },

So just add this file in package.json, no need to write another webpack.config.json

production mode is not explained

 

Still support parameters such as color watch process

So we set

 

"scripts": {
    "start": "webpack --mode development --watch --progress --colors"
  },

 This way you can listen for file changes and compile.

 

Tell the compiler, I tried to compile a console.log (1) speed is 28ms almost close to 0 speed.

Let's try to be more specific.

 

 Seems to be a lot faster than before

 

So use it without a doubt

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325040872&siteId=291194637