Skip to content

Commit 0d1dadb

Browse files
committed
ts_project_worker: default-initialize tsc outDir
Some time ago, the tsc_project macro changed behavior. Before, `out_dir` would always be set, whereas now it may be `None`. If `out_dir` is unset, this expression will result in an incorrect output directory being used: ``` host.optionsToExtend.outDir = `${host.optionsToExtend.outDir}/${SYNTHETIC_OUTDIR}`; ``` (Would result in `'undefined/__st_outdir__'`).
1 parent 419df90 commit 0d1dadb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ts/private/ts_project_worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ function createProgram(args, inputs, output, exit) {
704704
}
705705

706706
function applySyntheticOutPaths() {
707-
host.optionsToExtend.outDir = `${host.optionsToExtend.outDir}/${SYNTHETIC_OUTDIR}`;
707+
host.optionsToExtend.outDir = `${host.optionsToExtend.outDir || host.optionsToExtend.rootDir || '.'}/${SYNTHETIC_OUTDIR}`;
708708
if (host.optionsToExtend.declarationDir) {
709709
host.optionsToExtend.declarationDir = `${host.optionsToExtend.declarationDir}/${SYNTHETIC_OUTDIR}`
710710
}

0 commit comments

Comments
 (0)