Skip to content

Commit 8816fcb

Browse files
committed
using path-is-absolute
1 parent bf1fb9a commit 8816fcb

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

file-system-loader.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
var DepGraph = require('dependency-graph').DepGraph;
44
var nodeResolve = require('resolve');
5+
var pathIsAbsolute = require('path-is-absolute')
56

67
Object.defineProperty(exports, '__esModule', {
78
value: true
@@ -68,7 +69,7 @@ var FileSystemLoader = (function () {
6869
fileRelativePath = _path2['default'].resolve(rootRelativeDir, newPath);
6970

7071
// if the path is not relative or absolute, try to resolve it in node_modules
71-
if (newPath[0] !== '.' && newPath[0] !== '/') {
72+
if (newPath[0] !== '.' && !pathIsAbsolute(newPath)) {
7273
var paths;
7374
if (process.env.NODE_PATH) {
7475
paths = process.env.NODE_PATH.split(_path2['default'].delimiter);

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"css-modules-loader-core": "^1.1.0",
88
"dependency-graph": "^0.4.1",
99
"object-assign": "^3.0.0",
10+
"path-is-absolute": "^1.0.1",
1011
"promise-polyfill": "^2.1.0",
1112
"resolve": "^1.1.7",
1213
"string-hash": "^1.1.0",

0 commit comments

Comments
 (0)