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

35 lines
770 B
JavaScript

const common = require('./webpack.common.js')
const WorkboxPlugin = require('workbox-webpack-plugin')
module.exports = {
...common,
mode: 'production',
devtool: 'source-map',
plugins: [
...common.plugins,
new WorkboxPlugin.GenerateSW({
clientsClaim: true,
skipWaiting: true,
swDest: 'sw.js',
navigateFallback: '/',
navigateFallbackBlacklist: [/.*\?s=.*$/, /^\/stats/],
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]
}
}
}
]
})
]
}