【问题标题】:How to call `ng add` of library in custom `ng new`如何在自定义`ng new`中调用库的`ng add`
【发布时间】:2020-10-10 16:04:34
【问题描述】:

我有一个工作区,其中包括两个带有 ng add 原理图的角度库和一个带有自定义 ng new 原理图的原理图项目。

我想从我的ng new原理图中调用库的ng add原理图,这样我就不必在两个地方维护它们的设置了。

不幸的是,这似乎是不可能的,因为 externalSchematics 函数要求集合可用,这使得调用 ng add 毫无意义。

还有其他方法可以做到这一点吗?

【问题讨论】:

    标签: angular-schematics


    【解决方案1】:

    添加带有ng add 原理图的库作为原理图项目的依赖项实际上应该可以让您从自定义ng new 调用externalSchematics('library', 'ng-add', options)

    不幸的是,有一个回归错误,自从更改为 Angular 9 后这不起作用:https://github.com/angular/angular-cli/issues/18098

    【讨论】:

      猜你喜欢
      • 2019-12-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-24
      • 2021-05-06
      • 2013-05-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多