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) { exports.ensure = function (cb) {
if (!exports.loaded) if (!exports.loaded)
exports.getPackages(function (er, packages) { exports.getPackages(function (er, packages) {
pkg = Object.keys(packages).map(function (name) { requirejs.config({
packages: Object.keys(packages).map(function (name) {
return { return {
name: name, name: name,
location: packages[name].realPath location: packages[name].realPath
} }
}) })
;
console.log(["AAAAAAAAA", pkg]);
requirejs.config({
packages: pkg
}); });
exports.update(cb); exports.update(cb);

View file

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