-
Notifications
You must be signed in to change notification settings - Fork 137
/
vue.config.js
41 lines (38 loc) · 980 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
31
32
33
34
35
36
37
38
39
40
41
const pkg = require('./package.json')
module.exports = {
publicPath: '',
chainWebpack: config => {
config
.plugin('define')
.tap(args => {
args[0]['process.env'] = Object.assign(args[0]['process.env'], {
APP: {
name: JSON.stringify(pkg.name),
des: JSON.stringify(pkg.description),
version: JSON.stringify(pkg.version),
repo: JSON.stringify(pkg.repository.url)
}
})
return args
})
const svgRule = config.module.rule('svg')
svgRule.uses.clear()
svgRule
.oneOf('inline')
.resourceQuery(/inline/)
.use('vue-svg-loader')
.loader('vue-svg-loader')
.end()
.resourceQuery(/raw/)
.use('vue-svg-loader')
.loader('raw-loader')
.end()
.end()
.oneOf('external')
.use('file-loader')
.loader('file-loader')
.options({
name: 'assets/[name].[hash:8].[ext]'
})
}
}