【发布时间】:2019-12-13 12:09:19
【问题描述】:
我有一个使用 Angular CLI 创建的现有且已经很强大的 Angular 应用程序。
按照找到的说明 here 我将其设为 Nrwl Nx 工作区。
我跑了
ng add @nrwl/schematics
它创建了一个apps 和libs 文件夹,在apps 文件夹内有一个my-app 和一个my-app-e2e,都很完美。
然后,按照指令找到here我跑了
ng g app another-app
期望在我的apps 文件夹中创建一个应用程序,就像已经存在的一样,但它在根级别创建和another-app 文件夹(其中包含src 和e2e 文件夹),同一级别如apps 和libs。
我的angular.json 已正确更改,我可以通过它们的名称(ng s my-app 和 ng s another-app)为这两个应用程序提供服务。
这是预期的行为吗?原因,如 here 所示,显然当您使用
创建项目时create-nx-workspace
然后开始添加应用程序
ng g app another-app
所有应用都进入apps 文件夹。
【问题讨论】:
-
发现
ng g @nrwl/angular:app frontend可以解决问题。也许是因为我没有全局安装 nx/schematics,只是使用 Angular CLI 添加。
标签: angular angular-cli nrwl nrwl-nx