diff options
author | silverwind <me@silverwind.io> | 2023-05-31 04:07:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-31 02:07:04 +0000 |
commit | 50bd7d0b24016b0cf48dfbafe84b5953fe20c34f (patch) | |
tree | af5df7c26729ada5dbf27ba9d6b970bac35b49bc /webpack.config.js | |
parent | 28a89e360f720c5ca7fb71319beb2519adad5972 (diff) | |
download | gitea-50bd7d0b24016b0cf48dfbafe84b5953fe20c34f.tar.gz gitea-50bd7d0b24016b0cf48dfbafe84b5953fe20c34f.zip |
Remove the service worker (#25010)
It's been disabled by default since 1.17
(https://github.com/go-gitea/gitea/pull/18914), and it never really
delivered any benefit except being another cache layer that has its own
unsolved invalidation issues. HTTP cache works, we don't need two cache
layers at the browser for assets.
## :warning: BREAKING
You can remove the config `[ui].USE_SERVICE_WORKER` from your `app.ini`
now.
Diffstat (limited to 'webpack.config.js')
-rw-r--r-- | webpack.config.js | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/webpack.config.js b/webpack.config.js index e64f4acb5e..ae71a0599b 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -62,9 +62,6 @@ export default { fileURLToPath(new URL('web_src/js/standalone/swagger.js', import.meta.url)), fileURLToPath(new URL('web_src/css/standalone/swagger.css', import.meta.url)), ], - serviceworker: [ - fileURLToPath(new URL('web_src/js/serviceworker.js', import.meta.url)), - ], 'eventsource.sharedworker': [ fileURLToPath(new URL('web_src/js/features/eventsource.sharedworker.js', import.meta.url)), ], @@ -73,11 +70,7 @@ export default { devtool: false, output: { path: fileURLToPath(new URL('public', import.meta.url)), - 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.name === 'serviceworker' ? '[name].js' : 'js/[name].js'; - }, + filename: () => 'js/[name].js', chunkFilename: ({chunk}) => { const language = (/monaco.*languages?_.+?_(.+?)_/.exec(chunk.id) || [])[1]; return `js/${language ? `monaco-language-${language.toLowerCase()}` : `[name]`}.[contenthash:8].js`; |