The webpack configuration in vue-cli includes configurewebpack and chainwebpack. They both configure webpack, but the configuration methods are different.

In the vue2 project, the official vue-cli scaffolding will be used, and there will be the configuration file vue.config.js

The vue.config.js file related to webpack is configurewebpack and chainwebpack

Both of them can configure webpack, but the configuration methods are different.

configurewebpack is an object

chainwebpack is a function. The parameter of this function is the instance object of webpack-chain. You can change it through this instance object.


configurewebpack changes the configuration in the form of operating objects

chainwebpack changes the configuration through chain calls, which makes the changes more detailed.

Guess you like

Origin blog.csdn.net/Frank_colo/article/details/133343601