forked from rsksmart/rsk-explorer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
58 lines (53 loc) · 1.5 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
58
const pkg = require('./package.json')
module.exports = {
parallel: 0, // e2e test fails on circle-ci with parallel != 0
configureWebpack: {
performance: { hints: false }
},
css: {
sourceMap: true
},
chainWebpack: config => {
// remove console in production mode
/* config
.optimization.minimizer('terser').tap((args) => {
args[0].terserOptions.compress.drop_console = process.env.NODE_ENV === 'production'
return args
}) */
config
.plugin('define')
.tap(args => {
const env = args[0]['process.env']
const props = ['WS_URL', 'STATS_URL', 'GA_TAG', 'HOTJAR_ID', 'STREAM_MITM_URL', 'APPS_URL']
props.forEach((v) => {
env[v] = (process.env[v]) ? JSON.stringify(process.env[v]) : env['VUE_APP_' + v] || '""'
})
args[0]['process.env'] = Object.assign(env, {
APP: {
name: JSON.stringify(pkg.name),
version: JSON.stringify(pkg.version)
}
})
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]'
})
}
}