如何使用 angular-cli 编译多个 Angular 2 模块?
How can I compile multiple Angular 2 Modules with the angular-cli?
现在有没有办法使用 Angular CLI 编译多个应用程序节点?
当尝试 运行 "ng build -w" 时,它会在 "angular-cli.json" 文件的 "apps" 节点中找到第一个 "app"。
"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"
}
}
]
第二个应用程序 "someOtherApp" 不应该在之后立即开始编译吗?
按照文档中的说明使用 ng build --app=<id>
或 ng build --app=<name>
:https://github.com/angular/angular-cli/blob/master/docs/documentation/stories/multiple-apps.md
现在有没有办法使用 Angular CLI 编译多个应用程序节点?
当尝试 运行 "ng build -w" 时,它会在 "angular-cli.json" 文件的 "apps" 节点中找到第一个 "app"。
"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"
}
}
]
第二个应用程序 "someOtherApp" 不应该在之后立即开始编译吗?
按照文档中的说明使用 ng build --app=<id>
或 ng build --app=<name>
:https://github.com/angular/angular-cli/blob/master/docs/documentation/stories/multiple-apps.md