INNER CODE UNIT · TypeScript

isBundledRoute

vercel-community/rust · src/index.ts:151

function isBundledRoute(): boolean {
  if (existsSync('api/main.rs')) {
    const content = readFileSync('api/main.rs', 'utf8');
    return content.includes('bundled_api]') || content.includes('bundled_api(');
  }

  return false;
}

// Reference -  https://github.com/vercel/vercel/blob/main/DEVELOPING_A_RUNTIME.md#runtime-developer-reference
const runtime: Runtime = {
  version: 2,
  build: buildHandler,
  prepareCache: async ({ workPath }) => {
    debug(`Caching \`${workPath}\``);
    const cacheFiles = await glob('target/**', workPath);
    // Convert this into a reduce
    for (const f of Object.keys(cacheFiles)) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…