You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the SW script generated by @angular/service-worker is unminified. This was intentional so that it was easier to debug and the stack traces (that people having issues might provide) would be easier to interpret. This is not a major concern, since the SW scripts are aggressively cached by the browser and downloaded/parsed/executed out-of-band with page rendering.
Nonetheless, now that the SW is more stable, it may make sense to minify it for production (with sourcemaps for debugging).
Reacted by Sheik Althaf, Robin, Vlad Dumbrava, Sylvain Dumont, Michael Prentice, Sebastian Davids, Geoffrey Testelin, Marvin Heilemann, L Suarez and Maximilian Scharf
I'm struggling creating my own minification script. I was traying to use the cli version of terser, but --compress and --mangle seem to break the code. Could you give an example on how to use you minifying script @muuvmuuv ?
@blasco I have created a NodeJs script that gets the above files contents, uses the above minifier and overrides them. I will post my script tomorrow but it is pretty complex.
Activity
[-]feat(service-worker): minify Sw script (+ sourcemaps)[/-][+]feat(service-worker): minify SW script (+ sourcemaps)[/+]muuvmuuv commentedon Jul 2, 2020
Would love to see this in the next release. I have set up a minifier myself for some files:
Minify code
blasco commentedon Jul 20, 2020
I'm struggling creating my own minification script. I was traying to use the cli version of terser, but --compress and --mangle seem to break the code. Could you give an example on how to use you minifying script @muuvmuuv ?
muuvmuuv commentedon Jul 20, 2020
@blasco I have created a NodeJs script that gets the above files contents, uses the above minifier and overrides them. I will post my script tomorrow but it is pretty complex.
muuvmuuv commentedon Jul 21, 2020
@blasco
NodeJS script to minify files post build:
In package json:
tomdev9 commentedon Sep 10, 2020
@muuvmuuv can u add method from ./utils ? to run your minify.js cript ? thanks
muuvmuuv commentedon Sep 10, 2020
Here you go @tomastalian : https://gist.github.com/muuvmuuv/3f8fae0c12cc0859195c1be981c88a19
JeanMeche commentedon Aug 29, 2025
With #63364 we've announced that the service-worker package in now in maintenance mode and will not receive feature PRs and feature requests.
The message is also visible here: https://angular.dev/ecosystem/service-workers
angular-automatic-lock-bot commentedon Sep 29, 2025
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.