Skip to content

Commit 5e2c8c8

Browse files
committed
NODE_PATH env variable could be undefined
1 parent 1220cda commit 5e2c8c8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

file-system-loader.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,14 @@ var FileSystemLoader = (function () {
6969

7070
// if the path is not relative or absolute, try to resolve it in node_modules
7171
if (newPath[0] !== '.' && newPath[0] !== '/') {
72+
var paths;
73+
if (process.env.NODE_PATH) {
74+
paths = process.env.NODE_PATH.split(_path2['default'].delimiter);
75+
}
7276
try {
7377
fileRelativePath = nodeResolve.sync(newPath, {
7478
basedir: rootRelativeDir,
75-
paths: process.env.NODE_PATH.split(_path2['default'].delimiter)
79+
paths: paths
7680
});
7781
// in this case we need to actualize rootRelativePath too
7882
rootRelativePath = _path2['default'].relative(_this.root, fileRelativePath);

0 commit comments

Comments
 (0)