From 15039380f9e3ddaf42828375df92ca61a7c92238 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 17 Aug 2017 11:02:35 +0200 Subject: [PATCH] fix import --- src/app/compiler/compiler.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/compiler/compiler.js b/src/app/compiler/compiler.js index 3c0a7a9d87..cce168e61e 100644 --- a/src/app/compiler/compiler.js +++ b/src/app/compiler/compiler.js @@ -236,7 +236,12 @@ function Compiler (handleImportCall) { while ((match = importRegex.exec(files[fileName]))) { var importFilePath = match[1] if (importFilePath.startsWith('./')) { - importFilePath = importFilePath.slice(2) + var path = /(.*\/).*/.exec(target) + if (path !== null) { + importFilePath = importFilePath.replace('./', path[1]) + } else { + importFilePath = importFilePath.slice(2) + } } // FIXME: should be using includes or sets, but there's also browser compatibility..