When you make a project with the Meteor framework, it packages all the files together, but there doesn’t seem to be a way to explicitly say “I want this file to be loaded before that one”.
Let’s say, for example, I have 2 javascript files: foo.js and bar.js.
The file bar.js is actually containing code depending one the one inside foo.js but Meteor is loading bar.js before foo.js, breaking the project.
- In node.js I would simply use
require('./bar')insidefoo.js - In the browser, I would put a
<script>tag pointing tofoo.jsand another, after, pointing tobar.js, in order to load the files in the correct order.
How can we do that in Meteor?
According to the Meteor documentation, files are currently loaded in this order:
Source:
http://docs.meteor.com/#structuringyourapp