1. Install image-webpack-loader
npm install image-webpack-loader --save -dev
Copy the code
2. Errors were reported when the project was packaged, so uninstall it first and then use CNPM for input installation
npm uninstall image-webpack-loader
Copy the code
CNPM is used for installation, and the test is successful
3. Install CNPM and set the global registry to ali mirror. Ali is faster in China
npm install cnpm -g --registry=https://registry.npm.taobao.org
Copy the code
4, CNPM install image-webpack-loader will find it installed quickly
cnpm install --save-dev image-webpack-loader
Copy the code
5. After the installation, configure it in the vue.config. js file
ChainWebpack (config) {config.module. rule('images').use('image-webpack-loader') .loader('image-webpack-loader') .options({ bypassOnDebug: true }) .end() }Copy the code
The project can now be packaged normally