Skip to content

Commit ff9e7f5

Browse files
committed
fix(processor): resolve metadata extraction failure on Vercel
1 parent 4960d84 commit ff9e7f5

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

plugins/processor/index.mjs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Converter, ReflectionKind, Renderer } from 'typedoc';
22
import { MarkdownPageEvent } from 'typedoc-plugin-markdown';
33
import { getSourceMetadata } from './metadata.mjs';
4-
import { writeFileSync } from 'node:fs';
4+
import { readFileSync, writeFileSync } from 'node:fs';
55
import { join } from 'node:path';
66
import { applyExportEqualsReflections } from './exportEquals.mjs';
77
import { applySourceMetadata } from './source.mjs';
@@ -60,8 +60,15 @@ export function load(app) {
6060
}
6161
});
6262

63+
let libDir;
64+
const versions = JSON.parse(readFileSync('./versions.json'));
65+
66+
if (versions?.[0]) {
67+
libDir = `./.cache/webpack/${versions[0]}/lib`;
68+
}
69+
6370
applyExportEqualsReflections(context.project);
64-
applySourceMetadata(context.project);
71+
applySourceMetadata(context.project, libDir ? { libDir } : {});
6572
});
6673

6774
app.converter.on(Converter.EVENT_RESOLVE_END, context => {

0 commit comments

Comments
 (0)