mon-entreprise/source/webpack.prod.js

36 lines
770 B
JavaScript
Raw Normal View History

2018-07-05 09:54:41 +00:00
const common = require('./webpack.common.js')
2018-07-05 16:01:01 +00:00
const WorkboxPlugin = require('workbox-webpack-plugin')
module.exports = {
...common,
2018-03-12 15:37:23 +00:00
mode: 'production',
devtool: 'source-map',
2018-07-05 16:01:01 +00:00
plugins: [
2018-07-05 09:54:41 +00:00
...common.plugins,
2018-07-05 16:01:01 +00:00
new WorkboxPlugin.GenerateSW({
clientsClaim: true,
skipWaiting: true,
swDest: 'sw.js',
2018-07-12 08:09:41 +00:00
navigateFallback: '/',
navigateFallbackBlacklist: [/.*\?s=.*$/, /^\/stats/],
2018-07-05 16:01:01 +00:00
runtimeCaching: [
{
urlPattern: new RegExp(
'https://fonts.(?:googleapis|gstatic).com/(.*)|https://cdn.polyfill.io/v2/polyfill.min.js'
),
handler: 'cacheFirst',
options: {
cacheName: 'google-fonts',
expiration: {
maxEntries: 5
},
cacheableResponse: {
statuses: [0, 200]
}
}
}
]
})
2018-07-05 09:54:41 +00:00
]
}