Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ordering of the css and js files loaded by Meteor

Tags:

meteor

Is there any way of specifying an order to the automatically loaded css or js files loaded by Meteor.

Searched the docs and can't find anything.

I ask because I'm at the playing about stage, and am trying to use Twitter Bootstrap with Meteor. In the examples that come with Bootstrap the base bootstrap.css is always loaded before the bootstrap-responsive.css.

Any ideas?

like image 244
pharrisee Avatar asked Apr 11 '12 15:04

pharrisee


2 Answers

This question has since been answered in http://docs.meteor.com/

The JavaScript and CSS files in an application are loaded according to these rules:

Files in the lib directory at the root of your application are loaded first.

Files that match main.* are loaded after everything else.

Files in subdirectories are loaded before files in parent directories, so that files in the deepest subdirectory are loaded first (after lib), and files in the root directory are loaded last (other than main.*).

Within a directory, files are loaded in alphabetical order by filename.

These rules stack, so that within lib, for example, files are still loaded in alphabetical order; and if there are multiple files named main.js, the ones in subdirectories are loaded earlier.

like image 144
jpeskin Avatar answered Nov 05 '22 12:11

jpeskin


You are correct, user files are loaded depth first, alphabetically otherwise.

https://guide.meteor.com/structure.html#load-order

lib/ directories and main.* files are special cases.

Packages can also alter load order, but I don't think any of the default packages do that.

like image 16
n1mmy Avatar answered Nov 05 '22 12:11

n1mmy