How to stop webpack-dev-server programatically of a CLI command against the port ?
Ctrl-C etc are good for manually stopping the server. We are basically killing it.
Is there a API that the server exposes to issue a STOP command or something ?
How to stop webpack-dev-server programatically of a CLI command against the port ?
Ctrl-C etc are good for manually stopping the server. We are basically killing it.
Is there a API that the server exposes to issue a STOP command or something ?
Just came across this. Hopefully it's still relevant^^
According to documentation, the server can be opened and closed via node api as follows:
// create instance
const server = new WebpackDevServer(webpack(config), { });
// start
server.listen(8000, "localhost", err => {
console.log("server started")
})
// close/stop
server.close(() => {
console.log("server closed")
})
© 2022 - 2024 — McMap. All rights reserved.