Get the App
SLTechnology News&Howtos  ›  Development  › 

How vue adds less dependencies to scaffolding

Shulou Source: shulou.com Published: 2022-06-02 22:41:53 10月03日 Update

Xiaobian to share with you how vue add less dependence on scaffolding, I believe most people still do not know how, so share this article for everyone's reference, I hope you have a lot of harvest after reading this article, let's go to understand it together!

Add method: 1. Use "npm install less-loader --save" command to install less dependency;2. Modify "webpack.base.conf.js" file to configure loader to load dependency so that it supports external less.

This tutorial operating environment: Windows 7 system, vue2.9.6 version, DELL G3 computer.

vue Add less dependencies to scaffolding:

1. Installation with less dependency

npm install less less-loader --save

2. Modify the webpack.base.conf.js file, configure the loader to load dependencies, so that it supports external less, and add it to the model.

{ test: /\.less$/, loader: 'style-loader! css-loader! less-loader'},

Note:

TypeError: loaderContext.getResolve is not a function

This is because the less-loader version is too high, uninstall it, download a lower version again, and uninstall and install the lower version together.

That's all for "how vue adds less dependency to scaffolding", thanks for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!

Tags: Scaffolding versions articles content documents methods support configuration not much commands most tutorials more environment computers knowledge systems industry information information channels Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Linux Shulou Information Docker MariaDB