-
Notifications
You must be signed in to change notification settings - Fork 6
/
vue.config.js
42 lines (39 loc) · 1.07 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
const pkg = require('./package.json')
const repoName = pkg.repository.url.split('/').pop()
module.exports = {
publicPath: process.env.NODE_ENV === 'production' ? `/${repoName}/` : '/',
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]'
})
}
}