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
- In the context of Node, what is a
module
? In node a module is any file that includes a 'module.exports' statement allowing that code to be required in other files. - The code examples from the second blog post look very different from the first. Why? The second blog post is using RequireJS to achieve basically the same effect with different syntax. It seems as though RequireJS only allows access to the imported functions when wrapped in a require function.