-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathvue.config.js
46 lines (41 loc) · 1011 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
42
43
44
45
46
module.exports = {
configureWebpack: (config) => {
require('vux-loader').merge(config, {
options: {},
plugins: [
'vux-ui',
'duplicate-style',
{
name: 'less-theme',
path: 'src/theme.less',
},
],
})
},
chainWebpack: (config) => {
// set worker-loader
config.module
.rule('worker')
.test(/\.worker\.js$/)
.use('worker-loader')
.loader('worker-loader')
.end()
// 解决:worker 热更新问题
config.module.rule('js').exclude.add(/\.worker\.js$/)
},
devServer: {
https: false,
headers: {
'Cross-Origin-Embedder-Policy': 'require-corp',
'Cross-Origin-Opener-Policy': 'same-origin',
'Cross-Origin-Resource-Policy': 'same-site',
},
},
pluginOptions: {
i18n: {
localeDir: 'locales',
enableInSFC: false,
},
},
publicPath: process.env.NODE_ENV === 'production' ? '/' : '/',
}