web-dave/angular-starter-v2

config ngSW Routing

Opened this issue · 2 comments

  • generate a ngsw-manifest.json
  • add it to apps.0.assets
  • config your routes in your ngsw-manifest.json
  • build your app and try the routes

.angular-cli.json

{
  ...
  "apps": [
    {
      "root": "src",
      "outDir": "dist",
      "assets": [
        "assets",
        "favicon.ico",
        "ngsw-manifest.json" // <=
      ],
...

ngsw-manifest.json

{
  "routing": {
    "index": "/index.html",
    "routes": {
      "/": {
        "match": "exact"
      },
      "/books": {
        "match": "prefix"
      },
      "/about": {
        "match": "prefix"
      }
    }
  }
}