-
Notifications
You must be signed in to change notification settings - Fork 10
/
vue.config.js
45 lines (41 loc) · 1.01 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
// resolve: { alias: { mobx: __dirname + "/node_modules/mobx/lib/mobx.es6.js" }}
module.exports = {
css: {
loaderOptions: {
stylus: {
use: [require('autoprefixer-stylus')(), require('nib')()]
}
}
},
configureWebpack: config => {
if (process.env.NODE_ENV === 'production') {
config.module.rules.forEach(rule => {
if (rule.use) {
let idx = rule.use.findIndex(w => w.loader === 'thread-loader')
if (idx !== -1) rule.use.splice(idx, 1)
}
})
}
},
chainWebpack: config => {
config.resolve.extensions.prepend('.vue')
config.module
.rule('raw')
.test(/\.(vert|frag|glsl)$/)
.use('raw-loader')
.loader('raw-loader')
if (process.env.NODE_ENV === 'production') {
// disable cache (not sure if this is actually useful...)
config.module.rule('ts').uses.delete('cache-loader')
config.module
.rule('ts')
.use('ts-loader')
.loader('ts-loader')
.tap(opts => {
opts.transpileOnly = false
opts.happyPackMode = false
return opts
})
}
}
}