Deploying app as PWA
Learn how to deploy your app as PWA on a free Firebase hosting
To deploy the app as PWA , we will demonstrate using Firebase hosting.
Now, in your project directory, run
$ npm install -g firebase-tools
This will install Firebase tools in your project. Now login into Firebase using
$ firebase login
It will redirect you to browser, and authenticate using your google account. Once you are logged in, you can run this command to attach the code to your project.
$ firebase init
It will take you through a list of options for project setup.
This will create a
firebase.jsonfile which should look like the following
To add this package to the app run:
$ ng add @angular/pwa
Finally, build your project into production using
$ ionic build --prod
This will create a production build of your ionic app for PWA deployment. Use Firebase to deploy the app using
$ firebase deploy --only hosting
The Firebase console will show the deployment like this