DEV Community

Midhun Krishnan R
Midhun Krishnan R

Posted on

Installing your react.js local package registry to your project

If you are following a micro frontend architecture for your react project. You would have kept your ui-components in a different repo. (e.g: ui-elements).

If you wanted to install that micro frontend repo to your parent repo. Then follow these steps:

  1. Go to your repo which needed to be installed (e.g: ui-elements) and run build command:
npm build
Enter fullscreen mode Exit fullscreen mode
  1. Now copy the address to the repo. It would be something like:
    D:/<some-folder>/ui-elements

  2. Go to the repo where the package to be installed (e.g: parent-app)

  3. Go to your package.json file, give the package name in dependency and in the place of version you give "D://ui-elements"

  4. Now run:

npm i
Enter fullscreen mode Exit fullscreen mode

Your package is now installed.

Top comments (0)