Both, you can also use yarn lerna add @material-ui/core --scope=@my-org/my-monorepo-ui-lib at the root. In my experience it works well for single packages, if you want to add many it often doesn't.
Then you can import material ui Components in your own component inside the UI lib, e.g.
import{Button}from'@material-ui/core';
and run yarn story for adjusting it in storybook. Because it's a sub-dependency of the UI lib package, you'll have it included when you run CRA with yarn start as well.
Both, you can also use
yarn lerna add @material-ui/core --scope=@my-org/my-monorepo-ui-lib
at the root. In my experience it works well for single packages, if you want to add many it often doesn't.Then you can import material ui Components in your own component inside the UI lib, e.g.
and run
yarn story
for adjusting it in storybook. Because it's a sub-dependency of the UI lib package, you'll have it included when you run CRA withyarn start
as well.Very Very thank you for the quick reply, I tried it and it is working fine.
Can you please share how do I create the builds. Dev (minify with js map files) and Prod (complete minify) ?
Please suggest me something to achieve this.