-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
44 lines (43 loc) · 1.39 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// vue.config.js
const WebfontPlugin = require('webfont-webpack-plugin').default;
const path = require('path');
const isDev = process.env.NODE_ENV === 'development';
module.exports = {
chainWebpack: (config) => {
// scss common files
// const scssOneOfsMap = config.module.rule('scss').oneOfs.store;
// scssOneOfsMap.forEach((item) => {
// item
// .use('sass-resources-loader')
// .loader('sass-resources-loader')
// .options({
// resources: [`./src/styles/${isDev ? 'dev' : 'prd'}.scss`],
// })
// .end();
// });
// stylus common files
const stylusOneOfsMap = config.module.rule('stylus').oneOfs.store;
stylusOneOfsMap.forEach((item) => {
item
.use('style-resources-loader')
.loader('style-resources-loader')
.options({
patterns: [`./src/styles/${isDev ? 'dev' : 'prd'}.styl`],
})
.end();
});
},
configureWebpack: {
plugins: [
new WebfontPlugin({
fontName: 'm-font',
templateClassName: 'm-icon',
templateFontPath: '../../styles/fonts/',
files: path.resolve(__dirname, 'src/styles/icons/**/*.svg'),
dest: path.resolve(__dirname, 'src/styles/fonts'),
template: path.resolve(__dirname, 'src/styles/fonts/icon.styl'),
destTemplate: path.resolve(__dirname, 'src/styles/components'),
}),
],
},
};