-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove logging functionality #51
Comments
here's a temp workaround that you can add to your index file <script>
// This is a workaround used alongside the webpack-dev-server hot-module-reload feature
// - it's quite chatty on the console, and there's no currently no configuration option
// to silence it. Only used in development.
// Prevent messages starting with [HMR] or [WDS] from being printed to the console
(function(global) {
var console_log = global.console.log
global.console.log = function() {
if (!(
arguments.length == 1 &&
typeof arguments[0] === 'string' &&
arguments[0].match(/^\[(HMR|WDS)\]/)
)) {
console_log.apply(global.console,arguments)
}
}
})(window)
</script> |
Thank you @gdi2290 ! It works wonderful for console.log. [WDS] messages are rendered through the console.info and I've updated a bit your snippet for anyone needing this. Let me know if it can be improved. Thanks a lot!
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please view my question on StackOverflow for context/code example: https://stackoverflow.com/questions/44435999/angular2-hmr-hot-module-replacement-remove-the-logs
I just want to be able to opt out of the logging. I don't need a log for every single module that was reloaded, maybe just a single log saying successfully reloaded. Is there a way to override this functionality?
More context can be found in the same issue in webpack: webpack/webpack-dev-server#109
Thanks!
The text was updated successfully, but these errors were encountered: