Cassio Cabral
Cassio Cabral

Reputation: 2682

Meteor package load order

The order I add packages on Meteor makes any difference in the result ? Lets say I use bootstrap 3 and accounts ui with bootstrap 3, if I add the latter first or vice versa would work the same way ?

Upvotes: 5

Views: 2380

Answers (3)

rhythnic
rhythnic

Reputation: 63

There isn't currently a way to test for or access an optional dependency from within a package. You can test for it's existence by testing if Package['author:package'] is defined. The problem is the load order. I got around it temporarily by editing the packages file in .meteor and moving the optional dependency package higher up in the list. I don't think it's a good long term fix though. This should be a Meteor feature suggestion, if it's not already.

Upvotes: 0

Tarang
Tarang

Reputation: 75945

In Meteor the package order that you add them in does not matter.

There is a module in meteor called linker that analyses each packages dependencies to ensure that the dependencies load first.

For example: If bootstrap-3 is a dependency of accounts-ui-bootstrap-3 then even if bootstrap-3 was added after, it would be loaded first.

Upvotes: 7

Donny Winston
Donny Winston

Reputation: 2442

Each package has a package.json file that lists what other packages it requires. This practice ensures that packages load in a proper order. Read these files to troubleshoot load-order issues.

Upvotes: -1

Related Questions