Skip to content

Feature request: add ability to define angular.json in TypeScript as a .ts file #12943

@ilDon

Description

@ilDon

Bug Report or Feature Request

- [ ] bug report -> please search issues before submitting
- [x] feature request

Command (mark with an x)

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

Versions

Any

Desired functionality

Currently all configuration goes into one single file angular.json.

As some projects grow in dimensions, such json file can get long (in terms of lines) and messy (in terms of number of configurations and alike). To make life easier angular-cli could support also a configuration file in TypeScript (e.g. angular.ts).

Such file could be exporting: const config: AngularConfiguration = { ... }.

This would make it possible to split the different parts of the configurations in multiple sub-files, that we could import in angular.ts configuration constant, and all other awesome things that TypeScript allows us to do.

Mention any other details that might be useful

The cli could look first for angular.json, if it does not find it, it could look for angular.ts. Then, if angular.ts is present, it could parse the exported config constant (JSON.parse(config)) and work as usual.

Eventually, we could add to the TS config file the ability to define WebPack Plugins to be added to the build process, so that we do not need to run ng eject, keeping everything tide and clean. In this case, though, we would need a deeper review of the cli, as the parse route described above would not work for this purpose.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions