Ordering of the css and js files loaded by Meteor

后端 未结 3 1693
你的背包
你的背包 2020-12-02 14:12

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 becau

相关标签:
3条回答
  • 2020-12-02 14:45

    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.

    0 讨论(0)
  • 2020-12-02 15:00

    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.

    0 讨论(0)
  • 2020-12-02 15:04

    Running on windows, the other solutions didn't work for me so I just put all the js files into 1 folder and just number them. Meteor loads them in alphabetical order.

    0 讨论(0)
提交回复
热议问题