@@ -52,10 +52,6 @@ export const programFactory = (params: ProgramFactoryParams): ProgramFactory =>
52
52
const system = createFSBackedSystem ( vfsMap , projectRoot , ts , resolveDefaultLibsPath ( params ) ) ;
53
53
const config = resolveConfig ( params , system ) ;
54
54
55
- for ( const { filename, contents } of resolveLibs ( params ) ) {
56
- if ( contents ) system . writeFile ( '/' + filename , contents ) ;
57
- }
58
-
59
55
const rootNames = new Set ( config . fileNames ) ;
60
56
const options = {
61
57
getDefaultLibFilePath : ts . getDefaultLibFilePath ( config . options ) ,
@@ -177,11 +173,6 @@ export const programFactory = (params: ProgramFactoryParams): ProgramFactory =>
177
173
return factory ;
178
174
} ;
179
175
180
- interface LibFile {
181
- filename : string ;
182
- contents : string ;
183
- }
184
-
185
176
const defaultCompilerOptions = {
186
177
target : ts . ScriptTarget . Latest ,
187
178
} satisfies ts . CompilerOptions ;
@@ -209,23 +200,6 @@ const resolveDefaultLibsPath = (params: ProgramFactoryParams): string => {
209
200
}
210
201
} ;
211
202
212
- const resolveLibs = ( params : ProgramFactoryParams ) : readonly LibFile [ ] => {
213
- const tsPath = resolveDefaultLibsPath ( params ) ;
214
- const libs = ts . sys . readDirectory (
215
- path . resolve ( tsPath , 'lib' ) ,
216
- /*extensions*/ [ '.d.ts' ] ,
217
- /*exclude*/ [ 'typescript.d.ts' ] ,
218
- /*include*/ [ 'lib.*' ] ,
219
- /*depth*/ 1
220
- ) ;
221
- const output : LibFile [ ] = [ ] ;
222
- for ( const fileName of libs ) {
223
- const contents = ts . sys . readFile ( fileName , 'utf8' ) ;
224
- if ( contents ) output . push ( { filename : path . basename ( fileName ) , contents } ) ;
225
- }
226
- return output ;
227
- } ;
228
-
229
203
const resolveConfig = ( params : ProgramFactoryParams , system : ts . System ) : ts . ParsedCommandLine => {
230
204
const text = system . readFile ( params . configPath , 'utf8' ) || '{}' ;
231
205
const parseResult = ts . parseConfigFileTextToJson ( params . configPath , text ) ;
0 commit comments