I have a webpack project and I want to use Stylelint for SCSS linting. I have followed the instructions on the Stylelint website and installed:
"stylelint": "^12.0.1",
"stylelint-webpack-plugin": "^1.1.2",
And then I have put this in vue.config.js:
plugins: [
new StylelintPlugin({
files: '**/*.s?(a|c)ss'
})
],
And when I start the server I get this:
Invalid options in vue.config.js: "plugins" is not allowed
I have searched high and low but I have not found anything. Any help would be appreciated.
Here is the vue.config.js:
const StylelintPlugin = require('stylelint-webpack-plugin')
module.exports = {
plugins: [
new StylelintPlugin({
files: '**/*.s?(a|c)ss'
})
],
assetsDir: 'asset',
configureWebpack: config => {
config.entry = '@/wrapper/main.js'
},
chainWebpack: config => {
config.plugins.delete('prefetch')
},
lintOnSave: undefined,
runtimeCompiler: true
}
The easiest way to tweak the webpack config is providing an object to the configureWebpack option in vue.config.js:
// vue.config.js
module.exports = {
configureWebpack: {
plugins: [new MyAwesomeWebpackPlugin()]
}
}
The object will be merged into the final webpack config using webpack-merge.
Checkout https://cli.vuejs.org/guide/webpack.html for more information.