-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
47 lines (46 loc) · 1.13 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
const path = require('path');
// eslint-disable-next-line node/no-extraneous-require
const webpack = require('webpack');
module.exports = {
publicPath: './',
pluginOptions: {
i18n: {
locale: 'en',
fallbackLocale: 'en',
localeDir: 'locales',
enableLegacy: false,
runtimeOnly: false,
compositionOnly: false,
fullInstall: true,
},
},
configureWebpack: {
plugins: [
new webpack.DefinePlugin({
__APP_VERSION__: JSON.stringify(require('./package.json').version),
}),
],
},
chainWebpack: config => {
config.module
.rule('i18n-resource')
.test(/\.(json5?|ya?ml)$/)
.include.add(path.resolve(__dirname, './src/locales'))
.end()
.type('javascript/auto')
.use('i18n-resource')
.loader('@intlify/vue-i18n-loader');
config.module
.rule('i18n')
.resourceQuery(/blockType=i18n/)
.type('javascript/auto')
.use('i18n')
.loader('@intlify/vue-i18n-loader');
config.module
.rule('worker')
.test(/\.worker\.js$/)
.use('worker-loader')
.loader('worker-loader')
.end();
},
};