-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathvue.config.js
61 lines (60 loc) · 1.59 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
59
60
61
const baseConfig = {
}
module.exports = {
productionSourceMap: false,
parallel: false,
css: {
// extract: false,
},
publicPath: process.env.VUE_APP_PUBLIC_PATH || '/',
outputDir: process.env.VUE_APP_OUTPUT_DIR || 'dist',
configureWebpack: () => {
let extraConfig = {}
if (process.env.NODE_ENV === 'production') {
extraConfig = {
}
} else {
extraConfig = {
entry: './examples/main.js',
}
}
if (process.env.VUE_APP_IS_BUILDING_DOCS === 'true') {
extraConfig = {
entry: './examples/main.js',
}
}
return Object.assign(baseConfig, extraConfig)
},
chainWebpack: (config) => {
// config.module.rule('ts').uses.delete('thread-loader')
// config.module.rule('tsx').uses.delete('thread-loader')
config.module.rule('ts').uses.delete('cache-loader')
config.module.rule('tsx').uses.delete('cache-loader')
config.module
.rule('ts')
.use('ts-loader')
.loader('ts-loader')
.tap(opts => {
opts.transpileOnly = false
opts.happyPackMode = false
return opts
})
config.module
.rule('tsx')
.use('ts-loader')
.loader('ts-loader')
.tap(opts => {
opts.transpileOnly = false
opts.happyPackMode = false
return opts
})
if (process.env.NODE_ENV !== 'production' || process.env.VUE_APP_IS_BUILDING_DOCS === 'true') {
config
.plugin('html')
.tap((args) => {
args[0].template = './examples/index.html'
return args
})
}
},
}