npm private warehouse (nexus)-Vue components are published to nexus

1. Create a component project, enter the project directory and execute npm install to install dependencies, and npm run dev to run. At this time, the browser opens http://localhost:8080 to see the initialization page.

2. Create a new test component in the src directory, as shown in the figure below

3. Create a new component exposure file in the project directory

4. Modify package.json

Private must be changed to false before it can be published. When using this component in require mode, it can be found according to the main entrance. If not, it will find the index.js or index.node file in the root directory.

5. Modify webpack.config.js

6. Modify the js application path of index.html. Because the filename of output is modified, the name of the referenced file also changes.

7. Test whether it is correct and available

8. Build the target file and add commit ignore

9. Publish to nexus (the address is the address of creating npm warehouse npm private library (nexus)-create npm warehouse_QmagicianRX's blog-CSDN blog )

10. Used in projects (just use it like third-party components)

10.1 Installation

10.2 Quotes

10.3 Page usage

Guess you like

Origin blog.csdn.net/wuxiaoquan_520/article/details/130544511