Using less in vue-cli

Install less first, less-loader

npm install less less-loader --save-dev, you will see the picture below in package.json

After that, you can use less in the project without configuration.

Just import the less file directly in main.js, (css will be packaged after npm run build introduced in main.js)

 

Are you a little confused why you can use less in the project without configuration, hahahaha

Because there is utils.js in the webpack configuration to configure the loader for various preprocessing languages ​​of css

 I hope it can help you solve your doubts, please point out any mistakes, and make progress together.

 

Guess you like

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