Skip to content

Extend projects in Angular CLI workspace file (angular.json) #11244

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MickL opened this issue Jun 14, 2018 · 2 comments
Closed

Extend projects in Angular CLI workspace file (angular.json) #11244

MickL opened this issue Jun 14, 2018 · 2 comments

Comments

@MickL
Copy link

MickL commented Jun 14, 2018

Bug Report or Feature Request

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

Area

- [ ] devkit
- [X] schematics

Goal

Having one app that can be built with different styles/assets for multiple customers.

Current functionality

This works out very nice with in the angular.json in the projects object:

...
"projects": {
    "customer1": {
        ...
    }
    "customer2": {
        ...
    }
}
...

And then ng build customer1 and ng build customer2.

Anyway this creates tons of duplicate code. What if we have 20 customers(-> projects) and then decide to change just a single value, e.g. adding one more file to scripts array?

Desired functionality

Having one big-ass default project, extend it and just overwrite the values that need to be overwritten:

...
"projects": {
    "customer1": {
        ... outputPath, index, main, polyfills, tsConfig, styles, scripts, etc. etc. ...
       "assets": [
              "src/theme/customer1/assets"
       ],
       ...
    }
    "customer2": {
        "extends": "customer1",
         "assets": [
              "src/theme/customer1/assets"
       ]
    }
}
...
@MickL MickL changed the title Angular CL(angular.json): Extend projects Extend projects in Angular CLI workspace file (angular.json) Jun 14, 2018
@MickL
Copy link
Author

MickL commented Jun 14, 2018

Closing as a duplicate of #11233

@MickL MickL closed this as completed Jun 14, 2018
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant