Skip to content

Commit

Permalink
Merge pull request #141 from codepunkt/log_port_last
Browse files Browse the repository at this point in the history
refactor: change order of webpack stats logging and server setup
  • Loading branch information
swyxio authored Apr 16, 2019
2 parents 0074b4c + a04354e commit fd3d026
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions bin/cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,18 @@ program
.action(function(cmd, options) {
console.log("netlify-lambda: Starting server");
var static = Boolean(program.static);
var server = serve.listen(program.port || 9000, static, Number(program.timeout) || 10);
if (static) return; // early terminate, don't build
build.watch(cmd, program.config, function(err, stats) {
if (err) {
console.error(err);
return;
}


console.log(stats.toString({ color: true }));
var server = serve.listen(program.port || 9000, static, Number(program.timeout) || 10);
stats.compilation.chunks.forEach(function(chunk) {
server.clearCache(chunk.name);
});

console.log(stats.toString({ color: true }));
});
});

Expand Down

0 comments on commit fd3d026

Please sign in to comment.