Skip to content

Commit 434651f

Browse files
committed
Merge pull request #352 from imranismail/master
added --stdin flag to close on process exit
2 parents aa7cc8a + e8400b2 commit 434651f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

bin/webpack-dev-server.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ var optimist = require("optimist")
2222

2323
.boolean("lazy").describe("lazy")
2424

25+
.boolean("stdin").describe("stdin", "close when stdin ends")
26+
2527
.boolean("info").describe("info").default("info", true)
2628

2729
.boolean("quiet").describe("quiet")
@@ -79,6 +81,14 @@ if(!options.filename)
7981

8082
if(!options.watchOptions)
8183
options.watchOptions = firstWpOpt.watchOptions;
84+
85+
if(argv["stdin"]) {
86+
process.stdin.on('end', function() {
87+
process.exit(0);
88+
});
89+
process.stdin.resume();
90+
}
91+
8292
if(!options.watchDelay && !options.watchOptions) // TODO remove in next major version
8393
options.watchDelay = firstWpOpt.watchDelay;
8494

0 commit comments

Comments
 (0)