forked from leek-wars/leek-wars
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
77 lines (73 loc) · 2.03 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
const path = require('path')
const dotenv = require('dotenv')
const match = process.env.npm_lifecycle_script.match(/--mode\ (.*)/)
if (match) {
dotenv.config({ path: path.resolve(process.cwd(), 'src', 'env', '.env.' + match[1]) })
}
dotenv.config({ path: path.resolve(process.cwd(), 'src', 'env', '.env') })
module.exports = {
configureWebpack: {
performance: {
hints: false
}
},
pages: {
index: {entry: 'src/main-fr'},
'app-fr': {entry: 'src/main-fr'},
'app-en': {entry: 'src/main-en'},
'app-es': {entry: 'src/main-es'},
'app-de': {entry: 'src/main-de'},
'app-it': {entry: 'src/main-it'},
'app-pt': {entry: 'src/main-pt'},
'app-da': {entry: 'src/main-da'},
'app-fi': {entry: 'src/main-fi'},
'app-nl': {entry: 'src/main-nl'},
'app-no': {entry: 'src/main-no'},
'app-pl': {entry: 'src/main-pl'},
'app-sv': {entry: 'src/main-sv'},
'app-ru': {entry: 'src/main-ru'},
'app-hi': {entry: 'src/main-hi'},
'app-zh': {entry: 'src/main-zh'},
'app-id': {entry: 'src/main-id'},
'app-ja': {entry: 'src/main-ja'},
'app-ko': {entry: 'src/main-ko'},
},
chainWebpack: config => {
config.module
.rule('i18n')
.test(/\.\w\w\.i18n/)
.use('i18n')
.loader(path.resolve('./src/component-loader.js'))
.end()
config.module
.rule('lang')
.test(/\.\w\w\.lang/)
.use('lang')
.loader(path.resolve('./src/translation-loader.js'))
.end()
if (process.env.VUE_MODE === 'build') {
config.entryPoints.delete('index')
config.plugins.delete('html-index')
if (process.env.VUE_CLI_MODERN_BUILD) {
// Uncomment to analyze bundles
// config
// .plugin("webpack-bundle-analyzer")
// .use(BundleAnalyzerPlugin)
// .init(Plugin => new Plugin({}))
}
}
},
pwa: {
name: 'Leek Wars',
themeColor: '#4b9e06',
workboxPluginMode: 'InjectManifest',
workboxOptions: {
swSrc: './public/service-worker.js'
},
iconPaths: {
favicon32: 'image/favicon.png',
favicon16: 'image/favicon.png'
}
}
}