// webpack.config.js
// additional code, remove if not needed.
devServer: {
contentBase: path.join(__dirname, "dist"),
compress: true,
port: 9000
}
No output from console
http://localhost:9000/
webpack output is served from /build/
Content not from webpack is served from /path/to/dist/
Take over by a third party
What do you mean? You already have all infromation
If I understood correctly, they use case is not output at all.
The quiet option is explicitly bypassed for this logging, which is a bit of a pain if you're using the Node.js API and handling startup logging yourself:
Do we need another option to bypass the bypass? The least sarcastic option name I can think of for it is quietStart 😋
if (options.quiet === true && options.quietStart !== true) {
...
}
Planned for next, can be solved on master, because it is breaking change
Before that, it can be operated in this way
const backups = {};
function prohibitLog() {
const key = Object.keys(console);
for (const name of key) {
const value = console[name];
backups[name] = value;
console[name] = () => {};
}
}
function displayLog() {
const key = Object.keys(backups);
for (const name of key) {
const value = backups[name];
console[name] = value;
}
}
If the server is started through nodejs, it will be intercepted before startup and recovered after startup
prohibitLog();
server.listen(port, devServerOptions.host, () => {
displayLog();
});
@bosens-China Nice hack!
Since the logging is explicitly done at the info level, I've ended up using:
```js
// XXX Temporarily replace console.info() to prevent WDS startup logging which
// is explicitly done at the info level when the quiet option is set.
let info = console.info
console.info = () => {}
server.listen(port, host, (err) => {
console.info = info
// ...
}