1

I am trying to modify an SPA created via CRA typescript template. Modification is such that the project must be able to generate SPA and also a library through different scripts(npm run build, npm run build-library). While adding configuration to generate a library , I had to move react, react-dom as peer dependencies. But when running the project as SPA, one of the dependent library expects React to be present and be added as a dependency. So is there a way we could use react-app-rewired to conditionally configure peer dependencies?

0 Answers0