File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import {
2626 optionDeclarations ,
2727 parseCustomTypeOption ,
2828 ScriptTarget ,
29+ SourceFile ,
2930 toPath ,
3031 transpileOptionValueCompilerOptions ,
3132} from "./_namespaces/ts.js" ;
@@ -109,9 +110,11 @@ interface Symbol {
109110 readonly [Symbol.toStringTag]: string;
110111}` ;
111112const barebonesLibName = "lib.d.ts" ;
112- const barebonesLibSourceFile = createSourceFile ( barebonesLibName , barebonesLibContent , { languageVersion : ScriptTarget . Latest } ) ;
113+ let barebonesLibSourceFile : SourceFile | undefined ;
113114
114115function transpileWorker ( input : string , transpileOptions : TranspileOptions , declaration ?: boolean ) : TranspileOutput {
116+ barebonesLibSourceFile ??= createSourceFile ( barebonesLibName , barebonesLibContent , { languageVersion : ScriptTarget . Latest } ) ;
117+
115118 const diagnostics : Diagnostic [ ] = [ ] ;
116119
117120 const options : CompilerOptions = transpileOptions . compilerOptions ? fixupCompilerOptions ( transpileOptions . compilerOptions , diagnostics ) : { } ;
You can’t perform that action at this time.
0 commit comments