0.2.2 • Published 3 years ago
lapnn-dao-proposal v0.2.2
Development Guide
Development
yarn
# then
yarn devBuild
yarn
# then
yarn buildPublish
We are using clean-publish to make sure react (together with other unneeded stuff) is excluded in the published package.json:
npm run publishTroubleshootting
I see no react in depedencies and devDependencies, how can we run the project locally?
Having react in dependencies and devDependencies will cause issues while we try to test the lib out locally (e.g. installing to another project). Biggest problem is the app will see 2 different instance of React, one from itself & one from the lib. Things like hooks will stop working. Therefore, it's best we only specify react as peerDependencies.
So that's the problem, what's the solution?
Just symlink react and react-dom from other projects' node_modules:
npm link ../project_that_uses_the_lib/node_modules/react
npm link ../project_that_uses_the_lib/node_modules/react-dom