-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
30 lines (28 loc) · 835 Bytes
/
vue.config.js
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
30
/* eslint-disable */
const path = require("path");
const StylelintPlugin = require('stylelint-webpack-plugin');
function addStyleResource(rule) {
rule
.use("style-resource")
.loader("style-resources-loader")
.options({
patterns: [path.resolve(process.cwd(), "src/style/bem.scss")]
});
}
module.exports = {
configureWebpack: config => {
config.resolve.alias["@r$"] = path.resolve(process.cwd());
config.plugins.push(new StylelintPlugin({
// context: process.cwd(),
files: ['src/**/*.{css,scss,vue}'],
fix: true,
cache: true,
emitError: true,
emitWarning: true
}))
},
chainWebpack: config => {
const types = ["vue-modules", "vue", "normal-modules", "normal"];
types.forEach(type => addStyleResource(config.module.rule("scss").oneOf(type)));
}
}