0

I am using several packages from Atmosphere in my Meteor project. I would like to load a file I create before any file in those other packages load. I don't want to modify the source code of any of the Atmosphere packages.

Other stack overflow questions that mention load order here, and here reference the file load order section of the meteor docs. I'm not sure how this applies to the order that packages are loaded in.

Other advice on package load order mentions api.use, but I can't use app.use in the Atmosphere package since I don't want to modify their source code.

Any information about how meteor determines package load order without api.use would be helpful.

Community
  • 1
  • 1
zenev
  • 13
  • 5
  • why do you need that? – kodamirmo Dec 30 '15 at 09:43
  • If I understand correctly, the file you want to load first is not one of yours but one of those packages? With a few tweaks, you could create a package which load it through relative paths but it might break with updates. – ko0stik Dec 30 '15 at 11:13
  • @ko0stik It's actually my own file that I want to load first (see my edit). But loading it through relative paths still might work, could you clarify how I would do that? – zenev Dec 30 '15 at 16:36
  • @kodamirmo One of the packages I'm using publishes a collection which I don't want to be published. I could hide this by publishing a empty collection with the same name. Meteor will use whichever publish statement is loaded first. – zenev Dec 31 '15 at 15:31

1 Answers1

0

Given your informations, what you could do (and which is something I do all the time) is creating your own package with meteor create --package surname:package-name. Then you can load your file with Meteor's api.add_files and by editing your .meteor/packages you can edit the package load order according so the file you loaded through your package previously will be loaded before the other packages. Generally speaking, creating and putting parts of your apps in local packages like so is a good solution when you want to fine tune your load order, etc. If you want more insights on this, do not hesitate to google it, you've got plenty of ressources on the question.

ko0stik
  • 628
  • 5
  • 14
  • Unless there are dependencies, packages are loaded in the order they are specified with api.use, or in the .meteor/packages file. – zenev Jan 01 '16 at 20:44