Skip to content

Commit 6533213

Browse files
authored
Merge pull request microsoft#151830 from microsoft/joh/independent-lungfish
make sure ts-builder instance is being re-used
2 parents 1ccfebe + 175e811 commit 6533213

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

build/lib/tsb/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,11 @@ function create(projectPath, existingOptions, config, onError = _defaultOnError)
5151
}
5252
}
5353
// FULL COMPILE stream doing transpile, syntax and semantic diagnostics
54+
let _builder;
5455
function createCompileStream(token) {
55-
const _builder = builder.createTypeScriptBuilder({ logFn }, projectPath, cmdLine);
56+
if (!_builder) {
57+
_builder = builder.createTypeScriptBuilder({ logFn }, projectPath, cmdLine);
58+
}
5659
return through(function (file) {
5760
// give the file to the compiler
5861
if (file.isStream()) {

build/lib/tsb/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,13 @@ export function create(
7373
}
7474

7575
// FULL COMPILE stream doing transpile, syntax and semantic diagnostics
76+
77+
let _builder!: builder.ITypeScriptBuilder;
7678
function createCompileStream(token?: builder.CancellationToken): Readable & Writable {
7779

78-
const _builder = builder.createTypeScriptBuilder({ logFn }, projectPath, cmdLine);
80+
if (!_builder) {
81+
_builder = builder.createTypeScriptBuilder({ logFn }, projectPath, cmdLine);
82+
}
7983

8084
return through(function (this: through.ThroughStream, file: Vinyl) {
8185
// give the file to the compiler

0 commit comments

Comments
 (0)