WIP: ensure the stream is consumed before end/close are emitted.

This commit is contained in:
Bryce Gibson
2023-04-03 09:10:23 +10:00
parent 7febbbd89d
commit 049fda37ac
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -294,7 +294,7 @@ export class NexeCompiler {
return binary
}
const launchCode = this.code()
const vfsStream = await this.bundle.toStream()
const vfsStream = this.bundle.toStream()
let vfsSize = 0
const vfsSum = new Transform({
transform(chunk, _enc, cb) {
+2 -2
View File
@@ -41,8 +41,8 @@ export class Bundle {
}
}
public async toStream(): Promise<Readable> {
await this.zip.finalize()
public toStream(): Readable {
setTimeout(() => this.zip.finalize())
return this.zip
}
}