-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Suppress warnings in console #147
Comments
From @dnutels on May 26, 2016 6:46 Is there no response? At all? Having the ability to control the tool's logging level/output seems instrumental, yet there is currently no way to show only errors, while skipping (or folding) warnings... |
From @jorilallo on June 5, 2016 1:6 I would like to see a way to suppress warnings as well. As per #1617 many popular libraries (e.g. Quill, localforage) come build with Browserify, I don't really see the point of repackaging them and installing random loaders in the process. I would much rather use the original if it works and not see the warning contantly. |
This has actually been possible for a while, but it just hadn't been documented. You can find the documentation here. tl;dr: stats: {
warnings: false
} in the "root" of your webpack config, OR if you are using webpack-dev-server, in the |
Is there a way to do this from the CLI? |
@SpaceK33z is there a way to only suppress warnings on a certain line? I have server code that runs from webpack bundle in prod and straight from babel-node in dev, and I want to suppress the dynamic require warning only for this file. if (typeof __WEBPACK__ !== 'undefined') {
// flow-issue(toy-factory-tracker)
const requireMigration = require.context('../migrations/', false, /\.js$/)
migrations = requireMigration.keys().map(requireMigration)
} else {
migrations = (await promisify(glob)(path.resolve(__dirname, '..', 'migrations', '*.js'))).map(require)
} |
@SpaceK33z please update documentation reference link, currently the link to the answer 404's |
@Kielan here you go: https://webpack.js.org/configuration/stats/ (I fixed the link in @SpaceK33z comment as well) |
From @natew on March 15, 2015 0:18
We do dynamic route requires in a library that's used by people, and a lot of them are confused by this messaging:
Beyond some sort of console.log override, is there a way to suppress this warning even if only in the server-side output?
Copied from original issue: webpack/webpack#887
The text was updated successfully, but these errors were encountered: