Skip to content

Commit 1220cda

Browse files
committed
respect NODE_PATH env variable while resolving modules
1 parent 482a5b8 commit 1220cda

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: file-system-loader.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ var FileSystemLoader = (function () {
7070
// if the path is not relative or absolute, try to resolve it in node_modules
7171
if (newPath[0] !== '.' && newPath[0] !== '/') {
7272
try {
73-
fileRelativePath = nodeResolve.sync(newPath, { basedir: rootRelativeDir });
73+
fileRelativePath = nodeResolve.sync(newPath, {
74+
basedir: rootRelativeDir,
75+
paths: process.env.NODE_PATH.split(_path2['default'].delimiter)
76+
});
7477
// in this case we need to actualize rootRelativePath too
7578
rootRelativePath = _path2['default'].relative(_this.root, fileRelativePath);
7679
} catch (e) {}

0 commit comments

Comments
 (0)