I have a pretty basic question and I've read through the Meteor Application Structure but this is still a little confusing:
In meteor chef's understanding the imports directory, it says that:
The index.js file is implied by not specifying a filename on the end. This is also known as an "entry point" file.
When I ran meteor create testproject --full
to create a new project, in /client/main.js
it writes import '/imports/startup/client';
Why doesn't main.js include the index.js file directly?
Why does import '/imports/startup/client'
automatically include the index.js file only?
In Meteor's official documentation, index.js is not a reserved word.
- HTML template files are always loaded before everything else
- Files beginning with main. are loaded last
- Files inside any lib/ directory are loaded next
- Files with deeper paths are loaded next
- Files are then loaded in alphabetical order of the entire path
Quoted from another question.