How to use same local package in two projects?

左心房为你撑大大i 提交于 2019-12-25 07:52:44

问题


I have two projects: xxx-api and xxx-web, and both will use same local package xxx::libs

How to maintain xxx::libs ? currently I put xxx::lib under xxx-api, and whenever I update it, I will copy whole directory to xxx-web/packages.


回答1:


  1. Create a directory somewhere - let's call it /home/user/pacakges.
  2. Place your package (let's call it my-package) in that directory.
  3. export PACKAGE_DIRS="/home/user/packages"
  4. cd into your each app directory and meteor add my-pacakge (if you haven't already)

That's it! Meteor will always search your PACKAGE_DIRS before checking for any packages within your app. Make sure to add the export to your environment.

Fore more details I'd recommend reading my blog post on local pacakges.




回答2:


mgp may help you share private meteor packages in an easy way.
Maintain your xxx::libs in a separated directory.
And use mgp link to xxx::libs in your projects xxx-api and xxx-web.



来源:https://stackoverflow.com/questions/32061910/how-to-use-same-local-package-in-two-projects

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!