File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,18 +22,22 @@ function prepareTsTaskConfig(options: TscTaskOptions) {
2222 options . sourceMap = true ;
2323 }
2424
25+ const tsConfigProjectRoot = 'tsconfig.json' ;
2526 const tsConfigLib = 'tsconfig.lib.json' ;
2627 const isUsingTsSolutionConfigs = fs . existsSync ( resolveCwd ( tsConfigLib ) ) ;
2728
28- if ( isUsingTsSolutionConfigs ) {
29+ const tsConfig = JSON . parse ( fs . readFileSync ( resolveCwd ( tsConfigProjectRoot ) , 'utf-8' ) ) ;
30+ const isUsingV8pathAliases = tsConfig . extends && tsConfig . extends . includes ( 'tsconfig.base.v8.json' ) ;
31+
32+ if ( isUsingTsSolutionConfigs || isUsingV8pathAliases ) {
2933 // For converged packages (which use TS path aliases), explicitly set `baseUrl` and `rootDir` to current package root.
3034 // > - This is a temporary workaround for current way of building packages via lage and just scripts.
3135 // > - Without setting baseUrl we would get all aliased packages build within outDir
3236 // > - Without setting rootDir we would get output dir mapping following path from monorepo root
3337 logger . info ( `📣 TSC: package is using TS path aliases. Overriding tsconfig settings.` ) ;
3438 options . baseUrl = '.' ;
3539 options . rootDir = './src' ;
36- options . project = tsConfigLib ;
40+ options . project = isUsingTsSolutionConfigs ? tsConfigLib : tsConfigProjectRoot ;
3741 }
3842
3943 return options ;
You can’t perform that action at this time.
0 commit comments