@ng-toolkit/pwa

Extension for @angular/pwa - adds server-side rendering fixes and update mechanism

Usage no npm install needed!

<script type="module">
  import ngToolkitPwa from 'https://cdn.skypack.dev/@ng-toolkit/pwa';
</script>

README

Maintainability Test Coverage Build Status Dependency Status Backers on Open Collective Sponsors on Open Collective npm version

Extension for @angular/pwa package. Tweet

Star it and share with others!

This is part of the @ng-toolkit project. Check main page for more tools

Live demo

Angular Universal PWA on AWS Lambda + API Gateway

What's inside?

  • PWA support for serverside rendering (stop thinking about isPlatformBrowser in the code which touches PWA stuff)
  • Auto update mechanism in entry component

Getting started

Create or navigate into your project:

ng new myApp
cd myApp

apply packages

ng add @angular/pwa
ng add @ng-toolkit/pwa [--serverModule path/to/your/server.module.ts]

You can chain this package with:

If you did not use Angular CLI to install this package, you need to import NgtPwaMockModule in your server module:

@NgModule({
 bootstrap: [AppComponent],

    imports:[
        NgtPwaMockModule,
        BrowserModule.withServerTransition({appId: 'app-root'}),
        AppModule,
        ServerModule,
        ModuleMapLoaderModule,
        ServerTransferStateModule
    ]
})
export class AppServerModule {}

Looking for something more?

Feel free to create issue with your feature request

Funding

You can support development of this project via:

Open Collective Backers

Support this project with a monthly donation and help us continue our activities. [Become a backer]

Open Collective Sponsors

Become a sponsor and get your logo on our README on GitHub with a link to your site. [Become a sponsor]

Credentials

  • Checkout my home page and find out more about me