1

Can we provide the path for angular-cli.json to ng build, right now it doesn't seem to be supported.

Update:

What i am looking for is if we can have multiple angular-cli.json file with different name and that can be fed to ng build command something like

ng build --path\--config angular-cli-123.json 

enter image description here

3 Answers 3

1

Multiple apps are now supported out of the box.

Angular CLI support multiple applications within one project. You use the apps array in .angular-cli.json to list files and folders you want to use for different apps.

"apps": [
  {
    "root": "src",
    ...
    "main": "main.ts",
    "polyfills": "polyfills.ts",
    "test": "test.ts",
    "tsconfig": "tsconfig.app.json",
    "testTsconfig": "tsconfig.spec.json",
    "prefix": "app",
    ...
  },
  {
    "root": "src",
    ...
    "main": "main2.ts",
    "polyfills": "polyfills2.ts",
    "test": "test2.ts",
    "tsconfig": "tsconfig.app.json",
    "testTsconfig": "tsconfig.spec.json",
    "prefix": "app2",
    ...
  }  
]

To serve the first app: ng serve --app=0 or ng serve --app 0

To serve the second app: ng serve --app=1 or ng serve --app 1

Hope it helps, someone!!

Sign up to request clarification or add additional context in comments.

Comments

0

This answer might help.

Create a file called .ember-cli in your project, and include in it these contents:

{ "output-path": "./location/to/your/dist/" }

1 Comment

Thanks for this,but it doesnt help, I have updated my question with more details.
0

You cannot pass an angular-cli.json file to ng build, but you can pass --output-path.

I'd store multiple npm scripts in my package.json file like:

"scripts": {
  ...
  "build:123": "ng build --output-path \"dist-123\"",
  "build:456": "ng build --output-path \"dist-456\"",
}

2 Comments

The reason i need multiple angular-cli.json is, I have multiple apps with different configuration like src location of test scripts etc, I want to build them based upon there configuration. i can use --output-path for different output location, but the need is to build multiple apps using differnt src folders. Thanks!
I'd just use multiple Angular CLI projects for these to be honest.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.