-
Notifications
You must be signed in to change notification settings - Fork 8
/
vue.config.js
54 lines (48 loc) · 1.33 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
45
46
47
48
49
50
51
52
53
54
const path = require('path');
process.env.VUE_APP_VERSION = require('./package.json').version;
function resolvePublicPath() {
let p = '/sandwich';
switch (process.env.PROJECT_NAME) {
case 'editor':
p += '/editor';
break;
case 'site':
p += '/site';
break;
}
p += '/';
return p;
}
module.exports = {
outputDir: path.resolve(__dirname, `dist/${process.env.PROJECT_NAME}`),
publicPath: process.env.NODE_ENV === 'production' ? resolvePublicPath() : '/',
chainWebpack: config => {
// https://github.com/JetBrains/svg-sprite-loader
config.module
.rule('svg')
.uses.delete('file-loader')
.end()
.include.add(path.resolve(__dirname, 'src/common/svg-icon/icons'))
.end()
.use('svg-sprite-loader')
.loader('svg-sprite-loader')
.options({ symbolId: 'icon-[name]' })
.end()
.use('svg-transform-loader')
.loader('svg-transform-loader')
.end()
.use('svgo-loader')
.loader('svgo-loader')
.end();
},
pluginOptions: {
'style-resources-loader': {
preProcessor: 'less',
patterns: [
path.resolve(__dirname, './src/common/styles/normalize.less'),
path.resolve(__dirname, './src/common/styles/theme.less'),
path.resolve(__dirname, './src/common/styles/tool.less'),
],
},
},
};