【问题标题】:How to build multiple apps in angular 7 project in a single build command?如何在单个构建命令中在 Angular 7 项目中构建多个应用程序?
【发布时间】:2019-10-03 17:46:28
【问题描述】:

现在我需要在“ng build”中单独指定每个应用程序名称,以在 Angular 7 项目中构建每个应用程序(例如,ng build Myfirstapp、ng build MySecondApp)。

我需要在单个构建命令中构建所有应用程序(使用“ng build”仅构建 angular.json 中“defaultProject”中指定的应用程序名称)。

怎么做?

【问题讨论】:

    标签: angular build angular7


    【解决方案1】:

    您可以在 package.json 文件中定义一个运行所有 ng 构建的脚本,例如

    "scripts": {
      "build": "ng build Myfirstapp && ng build MySecondApp"
    }
    

    然后直接运行

    npm run build
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-02-12
      • 2019-09-09
      • 2020-08-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-20
      • 1970-01-01
      相关资源
      最近更新 更多