I’m trying to add pwa to an existing project but it doesn’t seem to work. I’ve also tried to add to a new project, but it doesn’t seem to follow the script for the Howtos online. Can anyone point to a working example?
Here’s how I started a new project:
ionic start ionic4-pwa blank --type=angular; cd ./ionic4-pwa
ng add @angular/pwa --project app
from this tutorial, https://www.joshmorony.com/create-a-pwa-with-angular-service-workers-in-ionic-4/, I’m expecting to find a file, ngsw-config.json
, but… nothing.
here’s my package.json
:
{
"name": "ionic4-pwa",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/common": "~6.1.1",
"@angular/core": "~6.1.1",
"@angular/forms": "~6.1.1",
"@angular/http": "~6.1.1",
"@angular/platform-browser": "~6.1.1",
"@angular/platform-browser-dynamic": "~6.1.1",
"@angular/pwa": "^0.10.5",
"@angular/router": "~6.1.1",
"@ionic-native/core": "5.0.0-beta.21",
"@ionic-native/splash-screen": "5.0.0-beta.21",
"@ionic-native/status-bar": "5.0.0-beta.21",
"@ionic/angular": "4.0.0-beta.15",
"core-js": "^2.5.3",
"rxjs": "6.2.2",
"zone.js": "^0.8.26"
},
"devDependencies": {
"@angular-devkit/architect": "~0.8.5",
"@angular-devkit/build-angular": "~0.8.5",
"@angular-devkit/core": "~0.8.5",
"@angular-devkit/schematics": "~0.8.5",
"@angular/cli": "~6.2.5",
"@angular/compiler": "~6.1.1",
"@angular/compiler-cli": "~6.1.1",
"@angular/language-service": "~6.1.1",
"@ionic/angular-toolkit": "^1.0.0",
"@types/jasmine": "~2.8.6",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~10.12.0",
"codelyzer": "~4.5.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~3.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.0",
"karma-jasmine": "~1.1.1",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~2.9.2"
},
"description": "An Ionic project"
}