Record summaries of your work

  1. NPM config set Registry registry.npmjs.org/

  2. NPM login (use your account and password to login to the NPM website)

  3. NPM Link local test

(1) Run the NPM link command on the folder where the NPM package is located to generate a global mapping. The left is the mapped global package, followed by node_modules with the package name

(2) If you run the NPM link package name in your project, the global mapping will be reflected in node_modules

  1. NPM publish publish (also use NPM publish with version change)

Note: If your NPM package has react syntax es6, you need to export it after Babel processes it. Otherwise node_modules processing will be filtered out in the use project

A simple Babel processing instruction:

Note that the main entry of the NPM package must be correct