mirror of
https://github.com/discourse/discourse.git
synced 2025-04-20 09:49:04 +08:00

The service worker isn't served via normal asset paths or the CDN. Instead, the ERB was being compiled by sprockets, fished out of the `public/` directory by the static_controller, and then the sprockets-specific stuff like `sourceMappingUrl` was being removed. Instead, we can put the ERB under `views/static/`, and have it evaluate at runtime. There are only a couple of super-cheap interpolations, plus the route is cached in nginx, so there is no performance concern. This takes us one step closer to removing sprockets.