1
0
Fork 0
mirror of https://github.com/betagouv/mon-entreprise synced 2025-02-09 02:55:01 +00:00
mon-entreprise/source/webpack.prod.js

35 lines
715 B
JavaScript
Raw Normal View History

2018-07-05 11:54:41 +02:00
const common = require('./webpack.common.js')
2018-07-05 18:01:01 +02:00
const WorkboxPlugin = require('workbox-webpack-plugin')
module.exports = {
...common,
2018-03-12 16:37:23 +01:00
mode: 'production',
2018-07-05 18:01:01 +02:00
plugins: [
2018-07-05 11:54:41 +02:00
...common.plugins,
2018-07-05 18:01:01 +02:00
new WorkboxPlugin.GenerateSW({
clientsClaim: true,
skipWaiting: true,
// chunks: ['bundle'],
swDest: 'sw.js',
2018-07-12 10:09:41 +02:00
navigateFallback: '/',
2018-07-05 18:01:01 +02: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 11:54:41 +02:00
]
}