Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
);
let opts: CompilerOptions = {
...config,
// Always emit output
noEmit: false,
noEmitOnError: false,
declaration: true,
declarationMap: true,
isolatedModules: false,
emitDeclarationOnly: true,
outFile: 'index.d.ts',
moduleResolution: ts.ModuleResolutionKind.NodeJs,
};
let host = new CompilerHost(options.inputFS, ts);
// $FlowFixMe
let program = ts.createProgram([asset.filePath], opts, host);
let includedFiles = program
.getSourceFiles()
.filter(file => path.normalize(file.fileName) !== asset.filePath)
.map(file => ({filePath: file.fileName}));
let mainModuleName = path
.relative(program.getCommonSourceDirectory(), asset.filePath)
.slice(0, -path.extname(asset.filePath).length);
let moduleGraph = new TSModuleGraph(ts, mainModuleName);
program.emit(undefined, undefined, undefined, true, {
afterDeclarations: [
// 1. Build module graph