diff --git a/src/compiler.ts b/src/compiler.ts index 65c96cb..64096a4 100644 --- a/src/compiler.ts +++ b/src/compiler.ts @@ -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) { diff --git a/src/fs/bundle.ts b/src/fs/bundle.ts index f206b6e..04c3be8 100644 --- a/src/fs/bundle.ts +++ b/src/fs/bundle.ts @@ -41,8 +41,8 @@ export class Bundle { } } - public async toStream(): Promise { - await this.zip.finalize() + public toStream(): Readable { + setTimeout(() => this.zip.finalize()) return this.zip } }