-
Notifications
You must be signed in to change notification settings - Fork 3
/
vue.config.js
57 lines (50 loc) · 1.34 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
55
56
57
const path = require('path');
module.exports = {
css: { extract: false },
productionSourceMap: false,
pluginOptions: {
webpackBundleAnalyzer: {
openAnalyzer: false,
},
},
configureWebpack: {
resolve: {
alias: {
'@': path.join(__dirname, './src'),
'@img': path.join(__dirname, './src/assets/img'),
'@scss': path.join(__dirname, './src/assets/scss'),
'@components': path.join(__dirname, './src/components'),
'@directives': path.join(__dirname, './src/directives'),
'@filters': path.join(__dirname, './src/filters'),
'@validators': path.join(__dirname, './src/validators'),
},
},
},
chainWebpack: (config) => {
config.module
.rule('images')
.use('url-loader')
.loader('url-loader')
.tap((options) => Object.assign(options, { limit: Infinity }));
const svgRule = config.module.rule('svg');
svgRule.uses.clear();
svgRule
.oneOf('url')
.resourceQuery(/url/)
.use('svg-url-loader')
.loader('svg-url-loader')
.end()
.end()
.oneOf('component')
.resourceQuery(/component/)
.use('vue-svg-loader')
.loader('vue-svg-loader')
.end()
.end()
.oneOf('default')
.use('vue-svg-loader')
.loader('vue-svg-loader')
.end()
.end();
},
};