Skip to content

Commit c09a173

Browse files
committed
Ensure serviceworker is created as /serviceworker.js (go-gitea#11577)
go-gitea#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 [email protected]
1 parent 3b1e114 commit c09a173

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ coverage.all
7676
/node_modules
7777
/yarn.lock
7878
/public/js
79+
/public/serviceworker.js
7980
/public/css
8081
/public/fonts
8182
/public/fomantic

webpack.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ module.exports = {
4747
filename: ({chunk}) => {
4848
// serviceworker can only manage assets below it's script's directory so
4949
// we have to put it in / instead of /js/
50-
return chunk.id === 'serviceworker' ? '[name].js' : 'js/[name].js';
50+
return chunk.name === 'serviceworker' ? '[name].js' : 'js/[name].js';
5151
},
5252
chunkFilename: 'js/[name].js',
5353
},

0 commit comments

Comments
 (0)