From 28883be5a964cb657b2dfc4e1d21d3b4a3141f8e Mon Sep 17 00:00:00 2001 From: Rich-Harris Date: Tue, 2 Jun 2015 19:16:35 -0400 Subject: [PATCH] avoid path.isAbsolute - not supported on old versions of node --- src/utils/resolvePath.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/utils/resolvePath.js b/src/utils/resolvePath.js index 12fcca8..c74bdc6 100644 --- a/src/utils/resolvePath.js +++ b/src/utils/resolvePath.js @@ -1,9 +1,11 @@ -import { dirname, isAbsolute, resolve, parse } from 'path'; +import { dirname, resolve, parse } from 'path'; import { readFileSync } from 'sander'; +const absolutePath = /^(?:\/|(?:[A-Za-z]:)?\\)/; + export function defaultResolver ( importee, importer, options ) { // absolute paths are left untouched - if ( isAbsolute( importee ) ) return importee; + if ( absolutePath.test( importee ) ) return importee; // we try to resolve external modules if ( importee[0] !== '.' ) {