3

I will start to develop a react that will be used by many internal react apps in my company. This library is starting from scratch, and there are many architectural decisions to be made about the components, utilities, REST client API, etc. To facilitate the development, the idea is to develop the library in parallel with the first react app.

For now, I created the library using create-react-library and deployed it in our internal Nexus 3 repository using npm publish. Also, I already created the react app using the create-react-app. During the development, I will start to watch the react app, and I want that every modification made on the library or in the app should be synchronized in the react app server.

My question is: How I can link locally the react library and the react-project, in such a way that I only start the react-project (npm start)?

João Pedro Schmitt
  • 1,046
  • 1
  • 11
  • 25

1 Answers1

1

You can push your library to git or other VCS, and then using the get link, you can register this as a package in your main repo.

Once the library is stable enough, release a tag and update the package URL to the tag. You can even publish this repo to NPM and install like any public dependency.

Reason to go with this approach is that since both are in development phase, it would be easier for you to maintain link on git or other VCS.

As an alternate, you can even use npm link which can also be used, but per my understanding, maintaining over VCS is more reliable as you can have different tag/ version of same project, and this also facilitates you to have parallel development without too much overlap.

Reference

Community
  • 1
  • 1
Rajesh
  • 24,354
  • 5
  • 48
  • 79