Automate serviceworker caching manifest generation #5245

Closed
opened 2025-11-02 06:19:01 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @silverwind on GitHub (Apr 16, 2020).

The script at https://github.com/go-gitea/gitea/blob/master/templates/pwa/serviceworker_js.tmpl should be replaced with something that automatically generates a appropriate service worker caching manifest based on the present files in public at compile time and then use that data together with StaticUrlPrefix at runtime to serve the actual URLs.

Normally, one would use a webpack plugin for this, but webpack can not know about StaticUrlPrefix, and also does not know about vendor files so it's not directly suitable, but could maybe be integrated in the compile-time part of the process.

Originally created by @silverwind on GitHub (Apr 16, 2020). The script at https://github.com/go-gitea/gitea/blob/master/templates/pwa/serviceworker_js.tmpl should be replaced with something that automatically generates a appropriate service worker caching manifest based on the present files in `public` at compile time and then use that data together with `StaticUrlPrefix` at runtime to serve the actual URLs. Normally, one would use a webpack plugin for this, but webpack can not know about `StaticUrlPrefix`, and also does not know about `vendor` files so it's not directly suitable, but could maybe be integrated in the compile-time part of the process.
GiteaMirror added the type/enhancementtopic/build labels 2025-11-02 06:19:01 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#5245