当前位置:网站首页>Debug through yalc before releasing NPM package

Debug through yalc before releasing NPM package

2022-06-25 07:13:00 Python's path to becoming a God

yalc effect

simulation npm install Install your own npm package , Install to local project , To test

Be careful : This method is only suitable for ordinary npm package , For that global package ( Such as :cli Tools ) Not suitable for

NPM: yalc

Common operations

  • Check all commands yalc help
  • see yalc Where the warehouse is located : yalc dir The output is similar to :C:\Users\sd401\AppData\Local\Yalc
  • Publish local modules to yalc Warehouse : Execute in the root directory of the project where the local module is located : yalc publish
  • In other projects introduce yalc Existing in the warehouse npm package : yalc add xxx, xxx Represents the package name
  • take yalc The latest version of the specified package in the warehouse is updated to the current project yalc update my-package
  • All used in the current project yalc Update the package in the warehouse to the latest version yalc update
  • Delete the specified... In the current project yalc Bags in the warehouse yalc remove my-package
  • Delete all... In the current project yalc Bags in the warehouse yalc remove --all
  • Unpublish yalc installations clean my-package

If you try to install or remove yalc Packages that do not exist in the warehouse will be similar to the following results

 Insert picture description here

How to modify global packages ( similar cli Tools ) Perform local installation and testing

install

Execute in the project root directory of the global package npm install -g, The execution will be completed in node Global module directory The corresponding global package appears ( In the form of soft connection
 Insert picture description here

Delete

npm uninstall -g my-package

Reference article

yalc: Probably the best front end link Commissioning plan
How to test gracefully locally npm package
yalc: Develop front-end plug-ins & Component ratio npm link Better to use
Local debugging npm Private packages use yalc + nodemon

原网站

版权声明
本文为[Python's path to becoming a God]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202201234082462.html