This commit is contained in:
Fabian Jakobs 2012-01-02 17:32:53 +01:00
commit 59acd23d2c
2 changed files with 14 additions and 5 deletions

View file

@ -38,12 +38,21 @@
/** /**
* Extremely simplified version of the requireJS text plugin * Extremely simplified version of the requireJS text plugin
*/ */
(function() {
var globalRequire = require;
define(function (require, exports, module) { define(function (require, exports, module) {
"use strict"; "use strict";
var net = require("ace/lib/net");
exports.load = function (name, req, onLoad, config) { exports.load = function (name, req, onLoad, config) {
net.get(req.toUrl(name), onLoad); if (req.isBrowser)
require("ace/lib/net").get(req.toUrl(name), onLoad);
else
//Using special require.nodeRequire, something added by r.js.
globalRequire.nodeRequire('fs').readFileSync(req.toUrl(name), 'utf8');
}; };
}); });
})();