Last active
August 29, 2015 14:22
-
-
Save adamotte/2907e031d4abdc8e37c5 to your computer and use it in GitHub Desktop.
Load json as require module
This file contains hidden or 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
//You need to have text plugin | |
//Define your module as this | |
define("module_name", [ | |
"text!../path/to/file.json" | |
], function(content){ | |
return eval('('+ content +')'); | |
}); | |
//load it | |
define("main", ["module_name"], function(module){ | |
console.log(module); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment