问题
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:
- Create a directory somewhere - let's call it
/home/user/pacakges
. - Place your package (let's call it
my-package
) in that directory. export PACKAGE_DIRS="/home/user/packages"
cd
into your each app directory andmeteor 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