简体   繁体   中英

How can I compile multiple Angular 2 Modules with the angular-cli?

Is there a way to compile multiple application nodes using Angular CLI at this time?

When trying to run "ng build -w" it finds the first "app" in the "apps" node of the "angular-cli.json" file.

"apps": [
{
  "root": "src",
  "outDir": "dist/backoffice",
  "assets": "assets",
  "index": "index.html",
  "main": "main.ts",
  "test": "test.ts",
  "tsconfig": "tsconfig.json",
  "prefix": "app",
  "mobile": false,
  "styles": [
    "styles.css"
  ],
  "scripts": [],
  "environments": {
    "source": "environments/environment.ts",
    "dev": "environments/environment.ts",
    "prod": "environments/environment.prod.ts"
  }
},
{
  "root": "someOtherApp",
  "outDir": "dist/someOtherApp",
  "assets": "assets",
  "index": "index.html",
  "main": "someOtherApp.ts",
  "test": "someOtherApp.ts",
  "tsconfig": "tsconfig.json",
  "prefix": "app",
  "mobile": false,
  "styles": [
    "styles.css"
  ],
  "scripts": [],
  "environments": {
    "source": "environments/environment.ts",
    "dev": "environments/environment.ts",
    "prod": "environments/environment.prod.ts"
  }
}

]

Shouldn't the 2nd application "someOtherApp" start to be compile right afterwards?

如文档中所述使用ng build --app=<id>ng build --app=<name>https : //github.com/angular/angular-cli/blob/master/docs/documentation/stories/多个应用程序

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM