From 64df777f77813be653b9948e89a56a0e817af698 Mon Sep 17 00:00:00 2001 From: Julian Scheid Date: Wed, 18 Nov 2015 11:29:29 +0100 Subject: [PATCH] Listen for close event rather than exit Listening to the exit event leads to occasional data loss. See https://github.com/nateps/connect-gzip/pull/18 --- lib/runner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/runner.js b/lib/runner.js index 912fc6b..8e558bd 100644 --- a/lib/runner.js +++ b/lib/runner.js @@ -59,7 +59,7 @@ exports.compile = function(input, options, callback) { compiler.stderr.on('data', function(data) { return stderr += data; }); - compiler.on('exit', function(code) { + compiler.on('close', function(code) { var error; if (code !== 0) { error = new Error(stderr);