vue.config.js中配置,已安装less,lessloader,style-resources-loader
方法1:报错less文件里的变量undefined
const path = require('path')
module.exports = {
pluginOptions: {
'style-resources-loader': {
preProcessor: 'less',
patterns: [
path.join(dirname, './style/less/vars.less')
]
}
}
}
方法2:报错config.plugin(...).use(...).options is not a function
const path = require('path')
module.exports = {
chainWebpack: config => {
config.plugin('style-resources')
.use(require('style-resources-loader'))
.options({
patterns: [
path.resolve(dirname, './style/less/vars.less')
]
})
}
}
请问到底如何配置

1***@163.com
- 发布:2024-05-16 17:33
- 更新:2024-05-16 17:33
- 阅读:201
0 个回复