From 3a4cf4ee3516aa67a9d52cb83b3cf931d015fec9 Mon Sep 17 00:00:00 2001 From: fabs Date: Tue, 21 Apr 2020 21:54:04 +0200 Subject: [PATCH] fix: paths separator on windows --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index d7e65f9..83cd949 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,6 @@ import _ from 'lodash'; import isThere from 'is-there'; -import path, {resolve, basename, extname} from 'path'; +import path, { resolve, basename, extname, dirname} from 'path'; import 'json5/lib/register'; // Enable JSON5 support @@ -12,7 +12,7 @@ export default function(options = {}) { let includePaths = this.options.includePaths ? this.options.includePaths.split(path.delimiter) : []; let paths = [] - .concat(prev.slice(0, prev.lastIndexOf('/'))) + .concat(dirname(prev)) .concat(includePaths); const resolver = options.resolver || resolve;