vue cli 3 以上添加Less支持
npm Less
npm install less less-loader --save
未验证下面这行是否必须
npm i style-resources-loader -D
vue.config.js
// vue.config.js const path = require('path') module.exports = { // 全局less变量 pluginOptions: { "style-resources-loader": { preProcessor: "less", // patterns: [path.resolve(__dirname, './src/assets/less/1.less')] patterns: [] } } };
慎于行,敏于思!GGGGGG