-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.config.js
57 lines (53 loc) · 1.36 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
const https = require('https')
const pkgJson = require('./package.json')
process.env.VUE_APP_VERSION = pkgJson.version
console.info('APP VERSION:', process.env.VUE_APP_VERSION)
const merge = require('webpack-merge')
const outputDir = 'dist'
const assetsDir = 'static'
module.exports = {
outputDir,
assetsDir,
configureWebpack: config => {
if (process.env.NODE_ENV === 'development') {
return {
devServer: {
public: `https://localhost:${process.env.WEB_APP_PORT}`, // For docker host
// host: 'localhost',
https: true,
port: process.env.WEB_APP_PORT,
watchOptions: {poll: true, ignored: /(node_modules|languages|dist|build|vendor|Docker|tests|backup|\.lock|\.git)/},
disableHostCheck: true,
historyApiFallback: true
},
devtool: 'source-map'
}
} else {
return {
}
}
},
pwa: {
name: pkgJson.appName || pkgJson.name,
workboxOptions: {
skipWaiting: true,
clientsClaim: true,
exclude: [
/\/\.\w+$/,
/\.(map|md|txt|ts|es6|lock)$/,
/img\/icons\//,
/favicon\.ico$/,
/manifest\.json$/,
/package\.json$/
]
}
},
chainWebpack: config => {
// Pug loader
config.module
.rule('pug')
.use('pug-plain-loader')
.loader('pug-plain-loader')
.end()
}
}