When building for production environment ngsw-worker/js file included in /DIST folder isn;y minified. We can save 75 KB and get better performance
Angular CLI: 1.7.3
Node: 9.5.0
OS: win32 x64
Angular: 5.2.8
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router, service-worker
@angular/cli: 1.7.3
@angular-devkit/build-optimizer: 0.3.2
@angular-devkit/core: 0.3.2
@angular-devkit/schematics: 0.3.2
@ngtools/json-schema: 1.2.0
@ngtools/webpack: 1.10.2
@schematics/angular: 0.3.2
@schematics/package-update: 0.3.2
typescript: 2.5.3
webpack: 3.11.0
The file contains 107KB of code
The file is minified and contains less than 35KB of code
Neither it is transpiled down to ES5. Service workers are supported in environments where async functions aren't (Chrome <= 54) so it fails.
It seems to be transpiled down to ES2015 now, using generators instead of async/await. Still no minification though.
Just leaving a note here... Be very careful about fixing this bug as a lot of people are working around this issue https://github.com/angular/angular/issues/21191 by inserting specific code in this very file. See comment: https://github.com/angular/angular/issues/21191#issuecomment-360051276
Maybe issue https://github.com/angular/angular/issues/21191 should be addressed first
EDIT: I know that this issue _shouldn't_ depend on the other one. If a fix is possible to minify ngsw-worker.js, it should be addressed.
Heya, this issue is the same as https://github.com/angular/angular-cli/issues/11538. I'm closing this one in favor of that one because it has an answer from the team member responsible for service workers.
@filipesilva this one is #9970, I guess you mean another.
@awerlang sorry about that, fixed the link now.
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._
Most helpful comment
Neither it is transpiled down to ES5. Service workers are supported in environments where async functions aren't (Chrome <= 54) so it fails.