This repository has been archived by the owner on May 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathvue.config.js
113 lines (110 loc) · 2.8 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
const CompressionPlugin = require('compression-webpack-plugin')
const webpack = require('webpack')
const https = require('https')
const keepAliveAgent = new https.Agent({ keepAlive: true })
module.exports = {
publicPath: '/',
css: {
loaderOptions: {
sass: {
prependData: '@import "~@/styles/_main.sass"',
sassOptions: {
indentedSyntax: true
}
}
}
},
chainWebpack: config => {
if (config.plugins.prefetch !== undefined) {
config.plugin('prefetch').tap(options => {
if (options.length > 0) {
options[0].include = 'allAssets'
}
return options
})
}
},
configureWebpack: {
entry: {
app: './src/main.js'
},
resolve: {
extensions: ['ts', 'js'],
alias: {
vue$: 'vue/dist/vue.esm.js'
}
},
output: {
globalObject: 'self'
},
plugins:
process.env.NODE_ENV === 'production'
? [
new CompressionPlugin({
filename: '[path].br[query]',
algorithm: 'brotliCompress',
test: /\.(js|css|html|svg|json)$/,
compressionOptions: { level: 11 },
minRatio: 1,
deleteOriginalAssets: false
}),
new webpack.DefinePlugin({
__VERSION__: JSON.stringify(require('./package.json').version)
})
]
: [
new webpack.DefinePlugin({
__VERSION__: JSON.stringify('dev')
})
]
},
pwa: {
name: 'traQ',
themeColor: '#0D67EA',
msTileColor: '#0D67EA',
appleMobileWebAppCapable: 'yes',
appleMobileWebAppStatusBarStyle: 'black',
assetsVersion: require('./package.json').version,
manifestPath: 'static/manifest.json',
manifestOptions: {
start_url: '/',
background_color: '#0D67EA',
icons: [
{
src: '/static/android-chrome-192x192.png',
sizes: '192x192',
type: 'image/png'
},
{
src: '/static/android-chrome-512x512.png',
sizes: '512x512',
type: 'image/png'
}
],
gcm_sender_id: '103953800507'
},
iconPaths: {
favicon32: 'static/favicon-32x32.png',
favicon16: 'static/favicon-16x16.png',
appleTouchIcon: 'static/apple-touch-icon.png',
maskIcon: 'static/safari-pinned-tab.svg',
msTileImage: 'static/mstile-150x150.png'
},
// configure the workbox plugin
workboxPluginMode: 'InjectManifest',
workboxOptions: {
// swSrc is required in InjectManifest mode.
swSrc: 'public/sw.js',
swDest: 'sw.js'
}
},
devServer: {
proxy: {
'^/api': {
target: 'https://traq-dev.tokyotech.org',
changeOrigin: true,
agent: keepAliveAgent
}
}
}
}