From e6343532848cdff9903eeb2a7a71df417a523672 Mon Sep 17 00:00:00 2001 From: mr-scrpt Date: Wed, 20 May 2020 12:17:58 +0300 Subject: [PATCH 1/2] Update index.js change sepatator for unix and windows slash --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 4573ff1..96b2d32 100644 --- a/src/index.js +++ b/src/index.js @@ -151,7 +151,7 @@ module.exports = function (config = {}) { log.all(id, 'looking in aliases') for (let [aliasName, aliasPath] of Object.entries(alias)) { log.all(id, 'looking in aliases', aliasName) - if (id.startsWith(aliasName + path.sep)) { + if (id.startsWith(aliasName + '/' || aliasName + '\\')) { log.match(id, 'matched alias', aliasName, aliasPath) let importPath = path.resolve(path.join(aliasPath, id.substring(aliasName.length))) let filepath = await findFile(importPath) From 5c01943501bc90961115f066e246610a9bbae4ab Mon Sep 17 00:00:00 2001 From: mr-scrpt Date: Wed, 20 May 2020 21:22:48 +0300 Subject: [PATCH 2/2] Update index.js corrections in the condition --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 96b2d32..64caca3 100644 --- a/src/index.js +++ b/src/index.js @@ -151,7 +151,7 @@ module.exports = function (config = {}) { log.all(id, 'looking in aliases') for (let [aliasName, aliasPath] of Object.entries(alias)) { log.all(id, 'looking in aliases', aliasName) - if (id.startsWith(aliasName + '/' || aliasName + '\\')) { + if (id.startsWith(aliasName + '/') || id.startsWith(aliasName + '\\')) { log.match(id, 'matched alias', aliasName, aliasPath) let importPath = path.resolve(path.join(aliasPath, id.substring(aliasName.length))) let filepath = await findFile(importPath)