Meteor 加载的 css 和 js 文件的排序 [英] Ordering of the css and js files loaded by Meteor

查看:16
本文介绍了Meteor 加载的 css 和 js 文件的排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Meteor 自动加载的 css 或 js 文件有什么方法可以指定顺序.

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.

我之所以这么问是因为我正在玩游戏,并且正在尝试将 Twitter Bootstrap 与 Meteor 结合使用.在 Bootstrap 附带的示例中,基本 bootstrap.css 总是在 bootstrap-responsive.css 之前加载.

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.

有什么想法吗?

推荐答案

此问题已在 http://docs.meteor.com 中得到解答/

应用程序中的 JavaScript 和 CSS 文件是根据这些规则:

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

应用程序根目录下的 lib 目录中的文件已加载首先.

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

匹配 main.* 的文件在其他所有文件之后加载.

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

子目录中的文件在父目录中的文件之前加载,以便首先加载最深子目录中的文件(之后lib),根目录下的文件最后加载(除了main.*).

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.

这些规则堆叠,所以在lib中,例如,文件仍然是按字母顺序加载;如果有多个文件命名main.js,子目录下的加载较早.

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.

这篇关于Meteor 加载的 css 和 js 文件的排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆