2018-12-11 16:31:48 +01:00
|
|
|
const config = require('sapper/config/webpack.js')
|
2018-12-16 02:36:36 +01:00
|
|
|
const terser = require('./terser.config')
|
2018-12-11 16:31:48 +01:00
|
|
|
const webpack = require('webpack')
|
2018-12-18 09:43:51 +01:00
|
|
|
const { mode, dev, resolve } = require('./shared.config')
|
2018-12-11 16:31:48 +01:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
entry: config.serviceworker.entry(),
|
|
|
|
output: config.serviceworker.output(),
|
2018-12-18 09:43:51 +01:00
|
|
|
resolve,
|
2018-12-16 04:21:20 +01:00
|
|
|
mode,
|
|
|
|
devtool: dev ? 'inline-source-map' : 'source-map',
|
2018-12-11 16:31:48 +01:00
|
|
|
plugins: [
|
|
|
|
new webpack.DefinePlugin({
|
2018-12-16 02:36:36 +01:00
|
|
|
'process.browser': true,
|
2018-12-16 04:21:20 +01:00
|
|
|
'process.env.NODE_ENV': JSON.stringify(mode),
|
2018-12-11 16:31:48 +01:00
|
|
|
'process.env.SAPPER_TIMESTAMP': process.env.SAPPER_TIMESTAMP || Date.now()
|
2018-12-16 02:36:36 +01:00
|
|
|
}),
|
|
|
|
terser()
|
2018-12-11 16:31:48 +01:00
|
|
|
]
|
|
|
|
}
|