File tree 1 file changed +4
-1
lines changed
1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ import {
26
26
optionDeclarations ,
27
27
parseCustomTypeOption ,
28
28
ScriptTarget ,
29
+ SourceFile ,
29
30
toPath ,
30
31
transpileOptionValueCompilerOptions ,
31
32
} from "./_namespaces/ts.js" ;
@@ -109,9 +110,11 @@ interface Symbol {
109
110
readonly [Symbol.toStringTag]: string;
110
111
}` ;
111
112
const barebonesLibName = "lib.d.ts" ;
112
- const barebonesLibSourceFile = createSourceFile ( barebonesLibName , barebonesLibContent , { languageVersion : ScriptTarget . Latest } ) ;
113
+ let barebonesLibSourceFile : SourceFile | undefined ;
113
114
114
115
function transpileWorker ( input : string , transpileOptions : TranspileOptions , declaration ?: boolean ) : TranspileOutput {
116
+ barebonesLibSourceFile ??= createSourceFile ( barebonesLibName , barebonesLibContent , { languageVersion : ScriptTarget . Latest } ) ;
117
+
115
118
const diagnostics : Diagnostic [ ] = [ ] ;
116
119
117
120
const options : CompilerOptions = transpileOptions . compilerOptions ? fixupCompilerOptions ( transpileOptions . compilerOptions , diagnostics ) : { } ;
You can’t perform that action at this time.
0 commit comments