The technical answer will be as above. Regarding the management of your components that will be used in two or more projects, I can also point you to an open source project that we have released for this very purpose.
People often post small packages or store an extensive utility library in one repo. These, in my opinion, cannot achieve true reuse simply because they require too much overhead.
During this problem, we developed an open source component management system called a bit: https://github.com/teambit/bit
This makes it easy to export and reuse code components in projects and repositories. He also cares about CI, version control, and just about everything we need. You can see an example for an open source reusable component called array / diff here on a free community hub .
Feel free to try and help out with pleasure if you need anything.
source share