Skip to content

ng build --watch and ng build should generate the same set of filenames #15157

@breathermachine

Description

@breathermachine

🚀 Feature request

Command (mark with an x)

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

Description

I'm building an Angular app that's served from a Spring Application. I want to use the target es2015 to take advantage of ES6 and differential loading. Is it possible to add an option add-target-suffix to ng build --watch so that it will build, for example, main-es2015.js and not just main.js? I'm asking for this request because I'm using ng build to fully generate the script files as part of a Spring Application build and at the same time use ng build --watch to speed up coding and testing of TypeScript code but these two operations generate differently named scripts.

Describe the solution you'd like

Depending on the target in tsconfig.json, ng build --watch --add-target-suffix should do the following:
es5: build main.js in order to align with ng build with es5 as the target
es2015: build main-es2015.js in order to align with ng build with es2015 as the target

If --add-target-suffix is not specified, then ng build --watch will perform the default behavior, so as not to break any existing build pipelines.

Describe alternatives you've considered

None at the moment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions