Meteor中文件加载规则

目录示例

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  of your HTML
client/head.html # content for  of your HTML:  tags, etc
client/style.css # some CSS code
client/.html # HTML templates related to a certain feature
client/.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中文件加载规则)