A new Angular Service Worker — creating automatic progressive web apps. Part 1: theory

Maxim Salnikov
Oct 2, 2017 · 8 min read
Image for post
Image for post

Quickstart

npm install @angular/service-worker@next --save

The flow will be following:

NGSW CLI

ngsw-config outputFolder sourceConfigurationFile baseHref
node_modules/.bin/ngsw-config dist ./src/ngsw-config.json
“build-prod-ngsw”: “ng build -prod && node_modules/.bin/ngsw-config dist ./src/ngsw-config.json && cp node_modules/@angular/service-worker/ngsw-worker.js ./dist/ngsw-worker.js”

Configuration file

assetGroups setting

dataGroups setting

Configuration file

npm run build-prod-ngsw

Resources

Image for post
Image for post
Me and Alex at ng-conf 2017

Progressive Web Apps

Progressive Web Apps Related Articles, Posts and Studies.

Maxim Salnikov

Written by

Oslo-based cloud and web front-end geek. Azure DevRel @ Microsoft. Google Dev Expert in Web. Public tech speaker & trainer. Mobile Era & ngVikings confs founder

Progressive Web Apps

Progressive Web Apps Related Articles, Posts and Studies. Discover AngularJS, Ionic & ReactJS progressive web app themes at https://pwathemes.com.

Maxim Salnikov

Written by

Oslo-based cloud and web front-end geek. Azure DevRel @ Microsoft. Google Dev Expert in Web. Public tech speaker & trainer. Mobile Era & ngVikings confs founder

Progressive Web Apps

Progressive Web Apps Related Articles, Posts and Studies. Discover AngularJS, Ionic & ReactJS progressive web app themes at https://pwathemes.com.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

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