- Loads all codes relative to a baseUrl
- With paths config you can setup locations of a group of scripts
- You can define modules in RequireJS in few different ways
- Simple name/value pairs
- Definition functions
- Definition functions with dependencies
- Define module as a function
- Define a module with a name
- Only one module should be defined per JavaScript file
- Normally you should not need to use require() to fetch a module, but instead rely on the module being passed in to the function as an argument.
- You can use global function requirejs.undef() to undefine a module
- RequireJS loads each dependency as a script tag, using head.appendChild()
Resources
0 comments:
Post a Comment