Angular 如何在其他库中共享库nx(nrwl)-singlerepo

Angular 如何在其他库中共享库nx(nrwl)-singlerepo,angular,nrwl-nx,Angular,Nrwl Nx,文件夹结构: 我想在状态和组件中使用@lib/api接口: 相对路径:。/../foo/xxx/bar/{…}.ts 有办法吗?您可以通过将路径添加到位于项目根目录下的tsconfig.json来实现这一点 { "compilerOptions": { "rootDir": ".", "baseUrl": ".", "paths": { "@lib/api-interfaces": ["/path/to/shared/api-interfaces.ts"]

文件夹结构:

我想在状态和组件中使用
@lib/api接口
: 相对路径:
。/../foo/xxx/bar/{…}.ts


有办法吗?

您可以通过将路径添加到位于项目根目录下的
tsconfig.json
来实现这一点

{
  "compilerOptions": {
    "rootDir": ".",
    "baseUrl": ".",
    "paths": {
      "@lib/api-interfaces": ["/path/to/shared/api-interfaces.ts"],
    }
  },
}

可以通过将路径添加到位于项目根目录下的
tsconfig.json
来实现这一点

{
  "compilerOptions": {
    "rootDir": ".",
    "baseUrl": ".",
    "paths": {
      "@lib/api-interfaces": ["/path/to/shared/api-interfaces.ts"],
    }
  },
}
这样就可以在tsconfig、nx.json、angular.json中配置lib,而无需手动添加它。 注意,这可能会删除任何现有代码,因此请先备份

这样就可以在tsconfig、nx.json、angular.json中配置lib,而无需手动添加它。
注意,这可能会删除任何现有代码,以便首先进行备份。

根目录下的代码根目录下的代码这样就不可能在其他LIB中使用wihtin它只能在其他应用程序中使用LIB在LIB中使用..?这样就不可能在其他LIB中使用wihtin它只能在其他应用程序中使用LIB在LIB中使用。。?
ng g @nrwl/workspace:lib api-interfaces