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

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

问题描述

有什么方法可以指定流星自动加载的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-sensitive.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.

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

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