angular / angular/angular-cli

Support web workers in libraries

Open
#15,059 34 comments 196 reactions 0 assignees View on GitHub
area: @schematics/angular feature feature: under consideration
Dominant language
TypeScript
Stars
27k
Forks
11.8k
Avg merge
14h 23m
Merged PRs (30d)
162

Description

# 🚀 Feature request

### Command (mark with an `x`)

```
- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [x] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
```

### Description
I would like to use Web Workers in an Angular 8 library project.
In version 8.1.1 this seems to be supported for project type 'application' only:
```console
ng generate webWorker my-module/myWorker --project my-lib
Web Worker requires a project type of "application".
```

### Describe the solution you'd like
Generating a Web Worker should work for project type 'library' as well.

### Describe alternatives you've considered
Rewrite TypeScript worker code to JavaScript file.

Contributor guide

Open the contributing guide

Research direction

Start by running `ng generate webWorker my-module/myWorker --project my-lib` and trace the generate command's project-type validation. Done means the command generates a Web Worker for a library project instead of reporting that workers require an application.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.