diff --git a/lib/requireServiceSync.js b/lib/requireServiceSync.js index 3091283..0bd5f99 100644 --- a/lib/requireServiceSync.js +++ b/lib/requireServiceSync.js @@ -52,10 +52,13 @@ function loadService (p, type) { var pkg; if (type === "file") { + service.localPath = path.resolve(p); + service.name = p.replace(/\.[^/.]+$/, ""); } else { try { pkg = JSON.parse(fs.readFileSync(path.resolve(p) + "/package.json").toString()); service.pkg = pkg; + service.localPath = path.resolve(p) + "/" + pkg.main; } catch (err) { // pkg not available, dont use throw err;