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
? -- A module is a part of an application that has a specific purpose. You can write an entire application in one module, or you can break a small application into many modules for better organization and readability. - The code examples from the second blog post look very different from the first. Why?
- Well they are obviously using a different text editor...;) but besides that, the code from the second sample is using require() instead of define in order to wrap the code. Require() gets passed list of dependencies and a function is executed when the dependencies are complete.
@rrgayhart