Skip to content

Prod build generates empty urls and patterns in ngsw.json for Angular Service Worker #10297

Closed
@webmaxru

Description

@webmaxru

Versions

Angular CLI: 6.0.0-rc.3
Node: 9.11.1
OS: darwin x64
Angular: 6.0.0-rc.3
... animations, cli, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router, service-worker

Repro steps

ng new testApp2
ng add @angular/pwa --project=testApp2
npm i @angular/service-worker@next --save (to workaround angular/devkit#679 )
ng build --prod

Observed behavior

resulting ngsw.json

{
  "configVersion": 1,
  "index": "/index.html",
  "assetGroups": [
    {
      "name": "app",
      "installMode": "prefetch",
      "updateMode": "prefetch",
      "urls": [],
      "patterns": []
    },
    {
      "name": "assets",
      "installMode": "lazy",
      "updateMode": "prefetch",
      "urls": [],
      "patterns": []
    }
  ],
  "dataGroups": [],
  "hashTable": {}
}

Desired behavior

urls and patterns should be populated by the entries reflecting the assets in dist/testApp2

Mention any other details that might be useful (optional)

This might be connected to the new folder structure - maybe NGSW CLI is still looking for the files in dist folder instead of dist/[projectName]

CC: @Brocco @alxhub

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions