Length | Points | Week |
---|---|---|
20 minutes | 10 | Week 2 |
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
- Fork This Gist
- Respond in your forked gist with answers to the following questions
- In the context of Node, what is a
module
? - A chunk of code that can be shared (required) between files by using
module.exports
at the end of the file you want to expose andrequire('path/to/file')
in the file that you want to import the module to. - The code examples from the second blog post look very different from the first. Why?
- The first post is using node to export modules, whereas the second post using RequireJS.
- In the context of Node, what is a