MCPcopy Create free account
hub / github.com/vercel/vercel / compile

Function compile

packages/node/src/typescript.ts:443–460  ·  view source on GitHub ↗
(
    code: string,
    fileName: string,
    skipTypeCheck?: boolean
  )

Source from the content-addressed store, hash-verified

441
442 // Create a simple TypeScript compiler proxy.
443 function compile(
444 code: string,
445 fileName: string,
446 skipTypeCheck?: boolean
447 ): SourceOutput {
448 const configFileName = detectConfig();
449 const buildOutput = getBuild(configFileName, skipTypeCheck);
450 const { code: value, map: sourceMap } = buildOutput(code, fileName);
451 const output = {
452 code: value,
453 map: Object.assign(JSON.parse(sourceMap), {
454 file: basename(fileName),
455 sources: [fileName],
456 }),
457 };
458 delete output.map.sourceRoot;
459 return output;
460 }
461
462 return compile;
463}

Callers

nothing calls this directly

Calls 3

detectConfigFunction · 0.85
getBuildFunction · 0.85
parseMethod · 0.45

Tested by

no test coverage detected