@@ -17,35 +17,18 @@ function generateTscCommandAndTempTsConfig(bsConfig, bstack_node_modules_path, c
17
17
const working_dir = path . dirname ( cypress_config_filepath ) ;
18
18
const typescript_path = path . join ( bstack_node_modules_path , 'typescript' , 'bin' , 'tsc' ) ;
19
19
const tsc_alias_path = path . join ( bstack_node_modules_path , 'tsc-alias' , 'dist' , 'bin' , 'index.js' ) ;
20
- const tsConfigFilePath = bsConfig . run_settings . ts_config_file_path ;
20
+ const tsConfigFilePath = path . resolve ( bsConfig . run_settings . ts_config_file_path ) ;
21
21
22
22
// Prepare base temp tsconfig
23
23
const tempTsConfig = {
24
+ extends : tsConfigFilePath , // Use a base tsconfig if available
24
25
compilerOptions : {
25
26
"outDir" : `${ path . basename ( complied_js_dir ) } ` , // Add ./ prefix for consistency
26
27
"listEmittedFiles" : true ,
27
- "allowSyntheticDefaultImports" : true ,
28
- "module" : "nodenext" ,
29
- "declaration" : false ,
30
- "baseUrl" : "." , // Default fallback baseUrl
31
- "skipLibCheck" : true
32
28
} ,
33
29
include : [ cypress_config_filepath ]
34
30
} ;
35
31
36
- // Inject paths and baseUrl from original tsconfig if available
37
- if ( tsConfigFilePath && fs . existsSync ( tsConfigFilePath ) && path . extname ( tsConfigFilePath ) . toLowerCase ( ) === '.json' ) {
38
- const tsConfig = JSON . parse ( fs . readFileSync ( tsConfigFilePath , 'utf8' ) ) ;
39
- if ( tsConfig . compilerOptions ) {
40
- if ( tsConfig . compilerOptions . paths ) {
41
- tempTsConfig . compilerOptions . baseUrl = path . dirname ( path . resolve ( tsConfigFilePath ) ) ;
42
- tempTsConfig . compilerOptions . paths = tsConfig . compilerOptions . paths ;
43
- }
44
- }
45
- } else {
46
- logger . warn ( `tsconfig file not found or invalid: ${ tsConfigFilePath } ` ) ;
47
- }
48
-
49
32
// Write the temporary tsconfig
50
33
const tempTsConfigPath = path . join ( working_dir , 'tsconfig.singlefile.tmp.json' ) ;
51
34
fs . writeFileSync ( tempTsConfigPath , JSON . stringify ( tempTsConfig , null , 2 ) ) ;
0 commit comments