@@ -37,13 +37,8 @@ function generateTscCommandAndTempTsConfig(bsConfig, bstack_node_modules_path, c
37
37
if ( tsConfigFilePath && fs . existsSync ( tsConfigFilePath ) && path . extname ( tsConfigFilePath ) . toLowerCase ( ) === '.json' ) {
38
38
const tsConfig = JSON . parse ( fs . readFileSync ( tsConfigFilePath , 'utf8' ) ) ;
39
39
if ( tsConfig . compilerOptions ) {
40
- if ( tsConfig . compilerOptions . baseUrl ) {
41
- // Use the directory containing the original tsconfig as baseUrl
42
- tempTsConfig . compilerOptions . baseUrl = path . dirname ( tsConfigFilePath ) ;
43
- } else {
44
- logger . warn ( `tsconfig at ${ tsConfigFilePath } does not define baseUrl, defaulting to "."` ) ;
45
- }
46
40
if ( tsConfig . compilerOptions . paths ) {
41
+ tempTsConfig . compilerOptions . baseUrl = path . dirname ( path . resolve ( tsConfigFilePath ) ) ;
47
42
tempTsConfig . compilerOptions . paths = tsConfig . compilerOptions . paths ;
48
43
}
49
44
}
@@ -92,6 +87,7 @@ exports.convertTsConfig = (bsConfig, cypress_config_filepath, bstack_node_module
92
87
try {
93
88
logger . debug ( `Running: ${ tscCommand } ` )
94
89
tsc_output = cp . execSync ( tscCommand , { cwd : working_dir } )
90
+ cp . execSync ( tscCommand , { cwd : working_dir } )
95
91
} catch ( err ) {
96
92
// error while compiling ts files
97
93
logger . debug ( err . message ) ;
@@ -103,7 +99,7 @@ exports.convertTsConfig = (bsConfig, cypress_config_filepath, bstack_node_module
103
99
104
100
// Clean up the temporary tsconfig file
105
101
if ( fs . existsSync ( tempTsConfigPath ) ) {
106
- // fs.unlinkSync(tempTsConfigPath);
102
+ fs . unlinkSync ( tempTsConfigPath ) ;
107
103
logger . info ( `Temporary tsconfig file removed: ${ tempTsConfigPath } ` ) ;
108
104
}
109
105
@@ -178,4 +174,4 @@ exports.readCypressConfigFile = (bsConfig) => {
178
174
fs . rmdirSync ( complied_js_dir , { recursive : true } )
179
175
}
180
176
}
181
- }
177
+ }
0 commit comments