diff --git a/remix-resolve/src/combineSource.js b/remix-resolve/src/combineSource.js index f08b8b2ee4..b8b451cb42 100644 --- a/remix-resolve/src/combineSource.js +++ b/remix-resolve/src/combineSource.js @@ -28,7 +28,8 @@ const combineSource = async function (rootpath, sources) { let subSorce = {} const response = await resolve(rootpath, fn) // sources[fileName].content = sources[fileName].content.replace(importLine, 'import' + extra + ' \'' + response.filename + '\';') - subSorce[fn] = { content: response.content } + const regex = /(\.+\/)/g + subSorce[fn.replace(regex, '')] = { content: response.content } sources = Object.assign(await combineSource(response.rootpath, subSorce), sources) } } catch (e) { diff --git a/remix-resolve/src/getFile.js b/remix-resolve/src/getFile.js index 92cf8f1d6e..fba0c1345f 100644 --- a/remix-resolve/src/getFile.js +++ b/remix-resolve/src/getFile.js @@ -1,4 +1,5 @@ const getFile = function (path, sources) { + // return sources[path].content return sources[path].content } diff --git a/remix-resolve/tests/test.js b/remix-resolve/tests/test.js index 7ea08b2111..e329e5e3c3 100644 --- a/remix-resolve/tests/test.js +++ b/remix-resolve/tests/test.js @@ -165,7 +165,7 @@ describe('testRunner', function () { const findImportsSync = function (path) { console.log(path) console.log(sources) - // return rr.getFile(path, sources) + return rr.getFile(path, combinedSources) } try { results = solc.compile(JSON.stringify(input), findImportsSync)