less
npm i less-loader less --save-dev
npm i style-resources-loader --save-dev
npm i vue-cli-plugin-style-resources-loader --save-dev
const path = require('path');
module.exports = {
transpileDependencies: [
'vuetify'
],
pluginOptions: {
"style-resources-loader": {
preProcessor: "less",
patterns: [
path.resolve(__dirname, "./src/assets/less/parameter.less")
]
}
},
css: {
loaderOptions: {
less: {
lessOptions: {
modifyVars: {
'primary-color': '#ec6800'
},
javascriptEnabled: true,
},
},
},
}
}
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
Syntax Error: TypeError: this.getOptions is not a function
说明less版本太高了,卸载重装7.x版本即可
npm uninstall --save less-loader
npm install -D less-loader@7.x
scss