Reputation: 11
My use case:
I have a Button component with Material UI. I want to export that component to bit component, but while compiling the bit build
, I get an error on Material UI modules:
How do I isolate a component if it has external library dependencies?
Upvotes: 1
Views: 429
Reputation: 594
You can reference dependencies (and peerDependencies) in the "workspace.jsonc" file like this:
"teambit.dependencies/dependency-resolver": {
"packageManager": "teambit.dependencies/pnpm",
"policy": {
"dependencies": {
"@angular/router": "13.0.3",
"@ngrx/effects": "13.0.1",
"@ngrx/store": "13.0.1",
"@ngx-translate/core": "14.0.0"
},
"peerDependencies": {}
}
},
Here is the documentation.
Certain use cases need "Compositions" to use building blocks in isolation, mocking how a component would function in a project.
Upvotes: 2