[Pkg-javascript-commits] [node-module-deps] 206/444: use pkg.__dirname where available

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:47:56 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-module-deps.

commit fd296ee9aaeb3c2dee2899755a99b42d5342d07d
Author: James Halliday <mail at substack.net>
Date:   Fri May 9 14:18:59 2014 -0700

    use pkg.__dirname where available
---
 index.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/index.js b/index.js
index ad1d14a..70648fe 100644
--- a/index.js
+++ b/index.js
@@ -209,7 +209,11 @@ Deps.prototype.getTransforms = function (file, pkg) {
     }
     
     function loadTransform (id, trOpts, cb) {
-        var params = { basedir: path.dirname(file) };
+        var params = {
+            basedir: pkg.__dirname && pkg.__dirname !== process.cwd()
+                ? pkg.__dirname
+                : path.dirname(file)
+        };
         nodeResolve(id, params, function nr (err, res, again) {
             if (err && again) return cb(err);
             

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-module-deps.git



More information about the Pkg-javascript-commits mailing list