Skip to content

Instantly share code, notes, and snippets.

@robbielane
Forked from rrgayhart/require.markdown
Last active February 16, 2016 22:12
Show Gist options
  • Save robbielane/d267e54c2b1026ff1f82 to your computer and use it in GitHub Desktop.
Save robbielane/d267e54c2b1026ff1f82 to your computer and use it in GitHub Desktop.
The Concept of Require

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 and answer the following questions:

  • In the context of Node, what is a module?

    • A module is a modular part of code that can be passed to different parts of your application.
  • The code examples from the second blog post look very different from the first. Why?

  • The second post is different because it uses a RequireJs. This uses the define() syntax.
@rrgayhart
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment