MCPcopy Create free account
hub / github.com/observablehq/framework / rewriteImportSource

Function rewriteImportSource

src/javascript/transpile.ts:103–106  ·  view source on GitHub ↗
(source: StringLiteral)

Source from the content-addressed store, hash-verified

101 }
102
103 async function rewriteImportSource(source: StringLiteral) {
104 const specifier = getStringLiteralValue(source);
105 output.replaceLeft(source.start, source.end, annotatePath(await resolveImport(specifier)));
106 }
107
108 for (const {name, node} of findFiles(body, path, input)) {
109 const source = node.arguments[0];

Callers 2

transpileModuleFunction · 0.70
ImportExpressionFunction · 0.70

Calls 3

getStringLiteralValueFunction · 0.85
replaceLeftMethod · 0.80
resolveImportFunction · 0.50

Tested by

no test coverage detected