question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple app defintions in the angular-cli.json "apps" : [ ] property

See original GitHub issue

Multiple app definitions

I noticed that inside the angular-cli.json file, the "apps": property is defined as an array. Is the following a valid example of the intended use for this property?

angular-cli.json :

{
  "project": {
    "version": "1.0.0-beta.26",
    "name": "example1"
  },
  "apps": [
    {
      "root": "src",
      "outDir": "dist",
      ...
    }, 
    {
      "root": "src2",
      "outDir": "dist2",
      ...
    }
  ],
  ...
}

I’ve tested with multiple definitions in the “apps”: property. And ng build always builds the first app defintiion.

If all these assumptions are correct, How do you use ng build to compile the second app definition?

Current Config.

angular-cli: 1.0.0-beta.26 node: 6.5.0 os: win32 x64 @angular/common: 2.4.4 @angular/compiler: 2.4.4 @angular/core: 2.4.4 @angular/forms: 2.4.4 @angular/http: 2.4.4 @angular/platform-browser: 2.4.4 @angular/platform-browser-dynamic: 2.4.4 @angular/router: 3.4.4 @angular/compiler-cli: 2.4.4

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

11reactions
sarathdrcommented, Feb 3, 2017

Is there a timeline for this? Could you suggest a workaround until then?

5reactions
clydincommented, Jan 25, 2017

That is the intended future use. However, only one app is currently supported.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular CLI: multiple apps in the same project - Yakov Fain
Say you have 2 apps: app1 and app2 configured in your .angular-cli.json. You can run builds separately: ng build --app app1 , and...
Read more >
Angular workspace configuration
The angular.json file at the root level of an Angular workspace provides workspace-wide and project-specific configuration defaults.
Read more >
How to build multiple applications with angular-cli?
The JSON schema for the apps element describes it this way: Properties of the different applications in this project.
Read more >
Understanding the Angular CLI Workspace File
An Angular Workspace is a project which is produced by the ng new command. An Angular Workspace able to consist the sources of...
Read more >
How to manage different environments with Angular CLI ...
Then when you run a build for QA, Angular CLI is going to use environment.qa.ts to read the environment.serverUrl property value and you're...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found