美文网首页
Meteor中文件加载规则

Meteor中文件加载规则

作者: 大女表哥 | 来源:发表于2016-08-15 15:06 被阅读0次

目录示例

lib/ # common code like collections and utilities
lib/methods.js # Meteor.methods definitions
lib/constants.js # constants used in the rest of the code

client/compatibility # legacy libraries that expect to be global
client/lib/ # code for the client to be loaded first
client/lib/helpers.js # useful helpers for your client code
client/body.html # content that goes in the <body> of your HTML
client/head.html # content for <head> of your HTML: <meta> tags, etc
client/style.css # some CSS code
client/<feature>.html # HTML templates related to a certain feature
client/<feature>.js # JavaScript code related to a certain feature

server/lib/permissions.js # sensitive permissions code used by your server
server/publications.js # Meteor.publish definitions

public/favicon.ico # app icon

settings.json # configuration data to be passed to meteor --settings
mobile-config.js # define icons and metadata for Android/iOS

文件加载顺序

文件加载规则:

  1. HTML template files are always loaded before everything else
  2. Files beginning with main. are loaded last
  3. Files inside any lib/ directory are loaded next
  4. Files with deeper paths are loaded next
  5. Files are then loaded in alphabetical order of the entire path

顺序示例:

nav.html
main.html
client/lib/methods.js
client/lib/styles.js
lib/feature/styles.js
lib/collections.js
client/feature-y.js
feature-x.js
client/main.js

相关文章

网友评论

      本文标题:Meteor中文件加载规则

      本文链接:https://www.haomeiwen.com/subject/nguusttx.html