Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export async function bundleDts(opts: BuildOptions, inputFile: string) {
const cachedDtsOutput = inputFile + '-bundled.d.ts';
if (!opts.isProd) {
try {
return await fs.readFile(cachedDtsOutput, 'utf8');
} catch (e) {}
}
const entries = [{
filePath: inputFile
}];
let outputCode = generateDtsBundle(entries).join('\n');
outputCode = cleanDts(outputCode);
await fs.writeFile(cachedDtsOutput, outputCode);
return outputCode;
}