Skip to content

Commit 2ef5e57

Browse files
author
Nathan Reid
committed
replace path.isAbsolute with sindresorhus/path-is-absolute ponyfill for old versions of Node
1 parent 8247670 commit 2ef5e57

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
},
99
"dependencies": {
1010
"icss-replace-symbols": "1.0.2",
11+
"path-is-absolute": "^1.0.0",
1112
"postcss": "5.0.10",
1213
"postcss-modules-values": "1.1.1",
1314
"postcss-modules-extract-imports": "1.0.0",

src/file-system-loader.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Core from './index.js'
22
import fs from 'fs'
33
import path from 'path'
4+
import pathIsAbsolute from 'path-is-absolute';
45

56
// Sorts dependencies in the following way:
67
// AAA comes before AA and A
@@ -39,7 +40,7 @@ export default class FileSystemLoader {
3940
trace = _trace || String.fromCharCode( this.importNr++ )
4041
return new Promise( ( resolve, reject ) => {
4142
let relativeDir = path.dirname( relativeTo ),
42-
fileRelativePath = path.resolve(path.isAbsolute(relativeDir) ? relativeDir : path.join( this.root, relativeDir ), newPath )
43+
fileRelativePath = path.resolve(pathIsAbsolute(relativeDir) ? relativeDir : path.join( this.root, relativeDir ), newPath )
4344

4445
// if the path is not relative or absolute, try to resolve it in node_modules
4546
if (newPath[0] !== '.' && newPath[0] !== '/') {

0 commit comments

Comments
 (0)