regexper-static/webpack.prod-web.js
2018-05-28 11:21:25 -04:00

33 lines
831 B
JavaScript

const merge = require('webpack-merge');
const common = require('./webpack.common.js');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const { GenerateSW } = require('workbox-webpack-plugin');
module.exports = merge(common, {
mode: 'production',
devtool: 'source-map',
plugins: [
new UglifyJSPlugin({
sourceMap: true
}),
new GenerateSW({
clientsClaim: true,
skipWaiting: true,
runtimeCaching: [
{
urlPattern: /https?:\/\/licensebuttons\.net/,
handler: 'staleWhileRevalidate'
},
{
urlPattern: /https?:\/\/fonts\.googleapis\.com/,
handler: 'staleWhileRevalidate'
},
{
urlPattern: /https?:\/\/fonts\.gstatic\.com/,
handler: 'staleWhileRevalidate'
}
]
})
]
});