From d717b23de12edae865b82f4129e004423ea9f469 Mon Sep 17 00:00:00 2001 From: Christophe Vidal Date: Mon, 10 Oct 2016 15:52:31 +0200 Subject: [PATCH] Avoid to append ./ automatically Currently, due to `./` being appended automatically to any file, it's not possible to resolve node_modules for example. --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index f7df93b..6ccc36d 100644 --- a/index.js +++ b/index.js @@ -5,9 +5,9 @@ var stringRegex = /(['"])((?:[^\\]\\\1|.)*?)\1/g; function replaceStringsWithRequires(string) { return string.replace(stringRegex, function (match, quote, url) { - if (url.charAt(0) !== ".") { - url = "./" + url; - } + //if (url.charAt(0) !== ".") { + // url = "./" + url; + //} return "require('" + url + "')"; }); }