Skip to content

Instantly share code, notes, and snippets.

@cmsd2
Created November 14, 2012 15:32
Show Gist options
  • Save cmsd2/4072785 to your computer and use it in GitHub Desktop.
Save cmsd2/4072785 to your computer and use it in GitHub Desktop.
Modify r.js to evaluate at compile time functions loaded by plugins.
diff --git a/node_modules/requirejs/bin/r.js b/node_modules/requirejs/bin/r.js
index f2b8faa..9451e32 100644
--- a/node_modules/requirejs/bin/r.js
+++ b/node_modules/requirejs/bin/r.js
@@ -1065,7 +1065,9 @@ var requirejs, require, define;
}
load = bind(this, function (value) {
- this.init([], function () { return value; }, null, {
+ var factory = function () { return value; };
+ factory.__requireJsBuild = true;
+ this.init([], factory, null, {
enabled: true
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment