This commit is contained in:
Egil Moeller 2015-04-11 16:57:58 +02:00
parent b86aa5d858
commit 9729af63e8
2 changed files with 3 additions and 8 deletions

View file

@ -19,17 +19,13 @@ exports.hooks = {};
exports.ensure = function (cb) {
if (!exports.loaded)
exports.getPackages(function (er, packages) {
pkg = Object.keys(packages).map(function (name) {
requirejs.config({
packages: Object.keys(packages).map(function (name) {
return {
name: name,
location: packages[name].realPath
}
})
;
console.log(["AAAAAAAAA", pkg]);
requirejs.config({
packages: pkg
});
exports.update(cb);

View file

@ -23,8 +23,6 @@ function loadFn(path, hookName, cb) {
functionName = parts[1];
}
console.log(["loadName", path, functionName]);
var handleFunction = function (fn) {
functionName = functionName ? functionName : hookName;
@ -38,6 +36,7 @@ function loadFn(path, hookName, cb) {
/* We're apparently in NodeJS, so try to load using the built-in require first */
try {
handleFunction(require(path));
console.warn("Module uses old CommonJS format: " + path);
} catch (e) {
requirejs([path], handleFunction);
}