forked from leek-wars/leek-wars
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
63 lines (61 loc) · 1.5 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
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin
const CopyWebpackPlugin = require('copy-webpack-plugin')
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: {
plugins: [
// new BundleAnalyzerPlugin(),
new CopyWebpackPlugin([{ from: 'src/wiki/image/', to: 'wiki' }])
],
performance: {
hints: false
}
},
pages: {
index: {entry: 'src/main-fr'},
'app-fr': {entry: 'src/main-fr'},
'app-en': {entry: 'src/main-en'}
},
devServer: {
proxy: {
'/api': {
target: 'http://localhost:5000'
}
}
},
chainWebpack: config => {
config.module
.rule('wiki')
.test(/\.wiki$/)
.use('wiki')
.loader(path.resolve('./src/wiki-loader.js'))
.end()
config.module
.rule('images')
.use('url-loader')
.loader('url-loader')
.tap(options => Object.assign(options, { limit: -1 }))
if (process.env.VUE_MODE === 'build') {
config.entryPoints.delete('index')
config.plugins.delete('html-index')
}
},
pwa: {
name: 'Leek Wars',
themeColor: '#4b9e06',
workboxPluginMode: 'InjectManifest',
workboxOptions: {
swSrc: 'public/service-worker.js'
},
iconPaths: {
favicon32: 'image/favicon.png',
favicon16: 'image/favicon.png'
}
}
}