Angular-cli: Allow user to specify angular-cli.json file to be used

Created on 7 Feb 2017  路  6Comments  路  Source: angular/angular-cli

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
Windows 10

Versions.

Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:
node: v6.9.4
npm: 3.10.10
angular-cli: 1.0.0-beta.26

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
This feature isn't currently available.

The log given by the failure.

Normally this include a stack trace and some more information.
Since multiple apps in a single angular-cli.json file are not currently supported. A simple workaround could be to specify the angular-cli.json configuration file that's being used. This could allow us to have a separate angular-cli.json file for each project and then specify which one we want used.

ng serve --config angular-cli.json.app1
ng serve --config angular-cli.json.app2

ng build --config angular-cli.json.app1
ng build --config angular-cli.json.app2

Mention any other details that might be useful.


Thanks! We'll be in touch soon.

Most helpful comment

Under v6, is there now any way to specify a different config file?
In the past I was using "projects" and the -a option, but with v6 it seems it always builds all projects, which is not what I want...

The overwhelming majority of systems that use config files have ways to specify the one you want.

All 6 comments

But then how it suppose to work with ng generate? It would be better just to support multiple apps

The same way I'm proposing it would work for any other ng command. You'd specify the angular-cli config file to be used. For backwards compatibility we should probably default it to use angular-cli.json located at root and just use the --config argument as an override.

ng generate --config angular-cli.json.app1
ng generate --config angular-cli.json.app2

We added support for multiple apps via https://github.com/angular/angular-cli/pull/4754.

There's no plan to support multiple config files at this point.

Under v6, is there now any way to specify a different config file?
In the past I was using "projects" and the -a option, but with v6 it seems it always builds all projects, which is not what I want...

The overwhelming majority of systems that use config files have ways to specify the one you want.

This would be great so that we can use Ionic apps inside a nx-workspace. Problem I'm facing is that we only want one angular.json, but ionic commands can only be run from within the project, and there is no way to specify the location of the root level angular.json. Having to manage multiple angular configs is ugly. Or, even a way to extend and 'fix' paths when loading relative angular.json.

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._

Was this page helpful?
0 / 5 - 0 ratings