-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
52 lines (48 loc) · 1.35 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
const path = require('path')
module.exports = {
configureWebpack: () => {
return {
resolve: {
extensions: ['.svg', '.vue', '.js'],
alias: {
'@img': path.resolve(__dirname, 'src/assets/img'),
'@icon': path.resolve(__dirname, 'src/assets/icon'),
},
},
performance: {
hints: 'warning',
maxAssetSize: 250000,
maxEntrypointSize: 380000,
assetFilter: (filename) => {
return filename.endsWith('.js')
},
},
}
},
chainWebpack: (config) => {
// Improve the "yarn build" output so it doesn't cause test failures.
// Config options here: https://github.com/kangax/html-minifier
config.plugin('html').tap((args) => {
args[0].minify = {
removeComments: true,
keepClosingSlash: true,
collapseWhitespace: true,
removeAttributeQuotes: false,
collapseBooleanAttributes: false,
removeScriptTypeAttributes: true,
}
return args
})
// Configure the Vue SVG Loader
const svgRule = config.module.rule('svg')
svgRule.uses.clear()
svgRule.use('vue-svg-loader').loader('vue-svg-loader')
// Configure the JS Yaml Loader
config.module
.rule('js-yaml-loader')
.test(/\.yml$/)
.use('js-yaml-loader')
.loader('js-yaml-loader')
.end()
},
}