Home > Article > Web Front-end > How to add less dependency to vue scaffolding
Adding method: 1. Use the "npm install less less-loader --save" command to install less dependencies; 2. Modify the "webpack.base.conf.js" file and configure the loader to load dependencies so that it supports External less is enough.
The operating environment of this tutorial: windows7 system, vue2.9.6 version, DELL G3 computer.
How to add less dependencies on vue scaffolding:
1. Install less dependencies
npm install less less-loader --save
2. Modify webpack .base.conf.js file, configure the loader to load dependencies so that it supports external less, add
{ test: /\.less$/, loader: 'style-loader!css-loader!less-loader' },
to the model. Note:
Possible errors: TypeError: loaderContext.getResolve is not a function
This is because the version of less-loader is too high. Uninstall it and re-download a lower version. Less will also be uninstalled and installed the lower version.
Related recommendations: "vue.js Tutorial"
The above is the detailed content of How to add less dependency to vue scaffolding. For more information, please follow other related articles on the PHP Chinese website!