@@ -60,12 +60,17 @@ function getCompilerOptions({
6060
6161 const compilerOptions : CompilerOptions = {
6262 target : ts . ScriptTarget . ES2015 ,
63- ...( convertedCompilerOptions as CompilerOptions ) ,
63+ ...convertedCompilerOptions ,
6464 // force module(resolution) to esnext and a compatible moduleResolution. Reason:
6565 // transpileModule treats NodeNext as CommonJS because it doesn't read the package.json.
6666 // Also see https://github.com/microsoft/TypeScript/issues/53022 (the filename workaround doesn't work).
6767 module : ts . ModuleKind . ESNext ,
68- moduleResolution : ts . ModuleResolutionKind . Node10 ,
68+ moduleResolution :
69+ convertedCompilerOptions . moduleResolution ===
70+ ts . ModuleResolutionKind . Bundler
71+ ? ts . ModuleResolutionKind . Bundler
72+ : ts . ModuleResolutionKind . Node10 ,
73+ customConditions : undefined , // fails when using an invalid moduleResolution combination which could happen when we force moduleResolution to Node10
6974 allowNonTsExtensions : true ,
7075 // Clear outDir since it causes source map issues when the files aren't actually written to disk.
7176 outDir : undefined ,
@@ -141,7 +146,10 @@ export function loadTsconfig(
141146 compilerOptionsJSON : any ,
142147 filename : string ,
143148 tsOptions : Options . Typescript ,
144- ) {
149+ ) : {
150+ options : ts . CompilerOptions ;
151+ errors : ts . Diagnostic [ ] ;
152+ } {
145153 if ( typeof tsOptions . tsconfigFile === 'boolean' ) {
146154 return { errors : [ ] , options : compilerOptionsJSON } ;
147155 }
0 commit comments