Convert absolute imports to relative ones.

pull/4512/head
Evan Sangaline 9 months ago committed by Aniket
parent cd69ee7cd1
commit e33c32aa7e
  1. 4
      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)
})
}

Loading…
Cancel
Save