Skip to content

Commit fd2f735

Browse files
committed
fix: support using preserveWatchOutput from tsconfig file
1 parent b923083 commit fd2f735

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

actions/build.action.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,12 @@ export class BuildAction extends AbstractAction {
232232
const isPreserveWatchOutputEnabled = options.find(
233233
(option) =>
234234
option.name === 'preserveWatchOutput' && option.value === true,
235-
);
235+
)?.value as boolean | undefined;
236236
watchCompiler.run(
237237
configuration,
238238
pathToTsconfig,
239239
appName,
240-
{ preserveWatchOutput: !!isPreserveWatchOutputEnabled },
240+
{ preserveWatchOutput: isPreserveWatchOutputEnabled },
241241
onSuccess,
242242
);
243243
} else {

lib/compiler/watch-compiler.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ import {
1616
import { TypeScriptBinaryLoader } from './typescript-loader';
1717

1818
type TypescriptWatchCompilerExtras = {
19-
preserveWatchOutput: boolean;
19+
/**
20+
* If `undefined`, the value of 'preserveWatchOutput' option from tsconfig
21+
* file will be used instead.
22+
*/
23+
preserveWatchOutput: boolean | undefined;
2024
};
2125

2226
export class WatchCompiler extends BaseCompiler<TypescriptWatchCompilerExtras> {
@@ -60,7 +64,8 @@ export class WatchCompiler extends BaseCompiler<TypescriptWatchCompilerExtras> {
6064
configPath,
6165
{
6266
...options,
63-
preserveWatchOutput: extras.preserveWatchOutput,
67+
preserveWatchOutput:
68+
extras.preserveWatchOutput ?? options.preserveWatchOutput,
6469
},
6570
tsBin.sys,
6671
createProgram,

0 commit comments

Comments
 (0)