Skip to content

ServiceWorker are not using --deploy-url #9753

Closed
@MitkoTschimev

Description

@MitkoTschimev

The service worker is loaded from the base url which is not working if i set a deploy-url

Versions

Angular CLI: 1.6.5
Node: 8.9.4
OS: darwin x64
Angular: 5.2.1
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router, service-worker

@angular/cli: 1.6.5
@angular-devkit/build-optimizer: 0.0.42
@angular-devkit/core: 0.0.29
@angular-devkit/schematics: 0.0.52
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.5
@schematics/angular: 0.1.17
typescript: 2.6.2
webpack: 3.10.0

Repro steps

  • ng build --deploy-url something/different/than/the/base/url

Observed behavior

Angular uses the base url instead of deploy-url

Desired behavior

The service worker is loaded by following rules:

  1. take absolute url if given
  2. fallback to deploy-url
  3. fallback to base url

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions