-
Notifications
You must be signed in to change notification settings - Fork 5
/
vue.config.js
47 lines (46 loc) · 1.54 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
module.exports = {
configureWebpack: config => {
if (process.env.NODE_ENV === 'production') {
// production config
const CompressionWebpackPlugin = require('compression-webpack-plugin')
const productionGzipExtensions = ['js', 'css']
config.plugins.push(
new CompressionWebpackPlugin({
asset: '[path].gz[query]',
algorithm: 'gzip',
test: new RegExp('\\.(' + productionGzipExtensions.join('|') + ')$'),
threshold: 10240,
minRatio: 0.90,
deleteOriginalAssets: false
})
)
} else {
// dev config
}
config.module.rules.push({
test: /\.mjs$/,
include: /node_modules/,
type: "javascript/auto",
})
config.resolve.extensions.push(".mjs")
},
pwa: {
// configure the workbox plugin
workboxOptions: {
runtimeCaching: [
{
urlPattern: /\.(?:png|gif|jpg|jpeg|svg)$/,
handler: 'cacheFirst',
options: {
cacheName: 'my-images-cache',
expiration: {
maxEntries: 60,
maxAgeSeconds: 24 * 60 * 60, // 1 Days
},
}
}
]
},
name: 'garage-sale'
}
}