summaryrefslogtreecommitdiffstats
path: root/webpack.config.js
diff options
context:
space:
mode:
Diffstat (limited to 'webpack.config.js')
-rw-r--r--webpack.config.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/webpack.config.js b/webpack.config.js
index d6a632ad1f..b1038c407d 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -35,13 +35,20 @@ module.exports = {
jquery: [
resolve(__dirname, 'web_src/js/jquery.js'),
],
+ serviceworker: [
+ resolve(__dirname, 'web_src/js/serviceworker.js'),
+ ],
icons: glob('node_modules/@primer/octicons/build/svg/**/*.svg'),
...themes,
},
devtool: false,
output: {
path: resolve(__dirname, 'public'),
- filename: 'js/[name].js',
+ filename: ({chunk}) => {
+ // serviceworker can only manage assets below it's script's directory so
+ // we have to put it in / instead of /js/
+ return chunk.id === 'serviceworker' ? '[name].js' : 'js/[name].js';
+ },
chunkFilename: 'js/[name].js',
},
optimization: {