I made a little progress over my previous response. Instead of copying ngsw-worker.js with a Unix-style specific command in package.json, only working for build not serve, I edited .angular-cli.json to add the following to the “assets” array:

The script is now available during ng server as well as being cross platform. Unfortunately the script then tries to load ngsw.json, which cannot be generated.

Seems the only way to test is to deploy to a real web server — which I realize needs to support https as well.

I’d like to see a follow-up guide (or actual documentation on angular.io!) that closes the loop on all of this.

--

--

Consulting Software Engineer and AWS Solutions Architect with over 34 years of experience. Specializing in AWS serverless application development and IoT.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Adam Fanello

Adam Fanello

40 Followers

Consulting Software Engineer and AWS Solutions Architect with over 34 years of experience. Specializing in AWS serverless application development and IoT.