Skip to content
This repository was archived by the owner on May 16, 2025. It is now read-only.

Commit 81ac539

Browse files
committed
fix: Error: write EPIPE (Issue #118)
1 parent cac6030 commit 81ac539

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/closure-compiler-plugin.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const fs = require('fs');
22
const path = require('path');
3+
const { Readable } = require('stream');
34
const googleClosureCompiler = require('google-closure-compiler');
45
const {
56
getFirstSupportedPlatform,
@@ -1044,9 +1045,7 @@ class ClosureCompilerPlugin {
10441045
resolve(outputFiles);
10451046
});
10461047

1047-
process.nextTick(() => {
1048-
compilerProcess.stdin.end(JSON.stringify(sources));
1049-
});
1048+
Readable.from(JSON.stringify(sources)).pipe(compilerProcess.stdin);
10501049
});
10511050
}
10521051

0 commit comments

Comments
 (0)