Created
July 3, 2014 13:38
-
-
Save seemikehack/ed605093b531fbb051fe to your computer and use it in GitHub Desktop.
RequireJS Dependencies and Automatic Script Loading
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(function (require) { | |
var a = require('a'), | |
b = require('b'); | |
// explicitly loading module | |
require('c'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You could define a "wrapper" module:
...then your original module would look like:
...and you would then load
wrapper
in all the places you previously referencedoriginal
.But I have to point out that this essentially makes the
original
module invalid--it has an implicit dependency that it isn't declaring. I can't think of a good reason to do this, but I could be convinced.