From 0e9c722d1b9140b36fd54e58c8238d38a05d1241 Mon Sep 17 00:00:00 2001 From: Evan Sangaline Date: Sun, 11 Feb 2024 13:35:01 -0600 Subject: [PATCH] Convert absolute imports to relative ones. --- libs/remix-ws-templates/src/script-templates/sindri/utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/remix-ws-templates/src/script-templates/sindri/utils.ts b/libs/remix-ws-templates/src/script-templates/sindri/utils.ts index 642582e651..13f20cbaae 100644 --- a/libs/remix-ws-templates/src/script-templates/sindri/utils.ts +++ b/libs/remix-ws-templates/src/script-templates/sindri/utils.ts @@ -62,8 +62,10 @@ export const compile = async (tags: string | string[] | null = ['latest']): Circ const circuitPath = normalizePath(sindriManifest.circuitPath || 'circuit.circom') const circuitContent = await remix.call('fileManager', 'readFile', circuitPath) const dependencies: {[path: string]: string} = await remix.call('circuit-compiler' as any, 'resolveDependencies', circuitPath, circuitContent) - Object.entries(dependencies).forEach(([rawPath, content]) => { + Object.entries(dependencies).forEach(([rawPath, rawContent]) => { + // Convert absolute file paths to paths relative to the project root. const path = normalizePath(rawPath) + const content = path.endsWith('.circom') ? rawContent.replace(/^\s*include\s+"\/([^"]+)"\s*;\s*$/gm, 'include "$1";') : rawContent filesByPath[path] = new File([content], path) }) }