From 723b1992711dc55548f0014552cc3b0a98bb86e8 Mon Sep 17 00:00:00 2001 From: zeripath Date: Sat, 23 May 2020 14:58:58 +0100 Subject: [PATCH] Ensure serviceworker is created as /serviceworker.js (#11577) #11538 moved the serviceworker to webbox but unfortunately created the serviceworker in public/js rather than public/ This PR fixes this, fixing multiple issues with broken js as a result of that change. Signed-off-by: Andrew Thornton art27@cantab.net --- .gitignore | 1 + webpack.config.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index d14544c72..9c4a15c9c 100644 --- a/.gitignore +++ b/.gitignore @@ -76,6 +76,7 @@ coverage.all /node_modules /yarn.lock /public/js +/public/serviceworker.js /public/css /public/fonts /public/fomantic diff --git a/webpack.config.js b/webpack.config.js index b1038c407..70a5029e6 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -47,7 +47,7 @@ module.exports = { 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'; + return chunk.name === 'serviceworker' ? '[name].js' : 'js/[name].js'; }, chunkFilename: 'js/[name].js', },