When you start working with WebPack for GameTime, you'll notice that you can't just define a variable in one file and find it in another as easily as you can in Rails.
Read Node.js, Require and Exports and Organize Your Code with RequireJS
- a module maps, or corresponds to, a file.
- They are using require.js which has its own syntax for requiring and exporting. Instead of using the
require()
method, require.js uses thedefine()
function to wrap a module of code. Exception -require()
is only used in the "main" file, which takes and array of dependencies.
👍