0

Imagine this typical Nx file structure represents my project. Is it possible to limit components from being referenced outside of their lib?

For example, I want the banner component to be available within the ui lib but not available for import in the data lib. There's a lot of "import bleeding" going on and I'm wondering if this can be limited and contained within their own lib?

myorg/
    ├── apps/
    │   ├── todos/
    │   ├── todos-e2e/
    │   └── api/
    ├── libs/
    │   ├── data/
    │   └── ui/
    │       ├── src/
    │       │   ├── lib/
    │       │   │   ├─ banner/
    │       │   │   │      ├── banner.template.html
    │       │   │   │      ├── banner.component.ts
    │       │   │   └── ui.module.ts
    │       │   └── index.ts
    │       ├── jest.conf.js
    │       ├── tsconfig.app.json
    │       ├── tsconfig.json
    │       ├── tsconfig.spec.json
    │       └── tslint.json
    ├── nx.json
    ├── package.json
    ├── tools/
    ├── tsconfig.json
    └── tslint.json
ignite-me
  • 738
  • 3
  • 14
  • 33

1 Answers1

0

In the libs/ui/src/index.ts file, you can specify what you want to export. Instead of the export * from './lib/banner/banner, choose what you want to export.

yElSaadany
  • 1
  • 1
  • 2