Sato
Sato

Reputation: 8602

How to use same local package in two projects?

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.

Upvotes: 0

Views: 59

Answers (2)

David Weldon
David Weldon

Reputation: 64312

  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.

Upvotes: 1

Max
Max

Reputation: 300

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.

Upvotes: 0

Related Questions