Skip to content

Adding web worker via "ng generate webWorker" does not generate differential builds #16275

@joshcomley

Description

@joshcomley

🐞 Bug report

Command (mark with an x)

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • xi18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

Unsure, I've only just encountered a scenario that would reveal this bug.

Description

Differential builds are not generated for web workers, only es2015.

2019-11-24 11_58_26-NgWorkerEs5Test

🔬 Minimal Reproduction

  • Step 1
    ng new NgWorkerDiffTest --routing=false --style=scss & cd NgWorkerDiffTest & ng generate webWorker MyWorker
  • Step 2
    Modify app.component.ts to include:

    if (typeof Worker !== "undefined") {
      const worker = new Worker("./my-worker.worker", { type: "module" });
    }

  • Step 3
    ng build or ng build --prod - neither will produce anything but es2015 for the worker.

🌍 Your Environment




Angular CLI: 9.0.0-rc.3
Node: 12.12.0
OS: win32 x64
Angular:
...

Package                      Version
------------------------------------------------------
@angular-devkit/architect    0.900.0-rc.3
@angular-devkit/core         9.0.0-rc.3
@angular-devkit/schematics   9.0.0-rc.3
@schematics/angular          9.0.0-rc.3
@schematics/update           0.900.0-rc.3
rxjs                         6.5.3

Anything else relevant?

In a way - IE11 will fail to load workers due to syntax errors.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions