Home >Web Front-end >JS Tutorial >Installing your react.js local package registry to your project

Installing your react.js local package registry to your project

Barbara Streisand
Barbara StreisandOriginal
2024-12-16 15:30:14308browse

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
  1. Now copy the address to the repo. It would be something like:
    D://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

Your package is now installed.

The above is the detailed content of Installing your react.js local package registry to your project. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn