You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Provide a way to mute warnings that can only be fixed with access to configuration #4263
Create React App doesn't expose Webpack configuration to the users, so any Webpack warnings that require fixes in config are non-actionable for our users. Unless they are critical (but in this case they should be errors), I would like to have an option to mute them.
#1617 is a good example of such warning. Create React App users have no control over it (when caused by third party libraries shipping a pre-built file). Just adding a noParse option wouldn't work for them because they can't change the config. For this warning specifically, there are also some users who consciously choose to use precompiled files (e.g. for build speed), so I'm not sure it's entirely relevant in all cases.
Another example of this being inconvenient is that this warning causes CI to fail for our users. We use eslint-loader and due to popular demand configured CI script to treat ESLint warnings as errors on CI. Unfortunately this also means unactionable Webpack warnings break the build. (react/create-react-app#1150)
Would you consider a feature request of muting warnings that are only actionable for people with access to the config?
Reacted by Eric Elliott, Shane McGraw, Marius Craciunoiu, Alexander Kachkaev, Tommy Falgout, Jimmy Miller, Zach Holman, Graham Swan, Kelly, Stalias and 3 more
And as @gaearon points out, it'd need to be external to the normal build configuration...
An environment value to optionally turn ON debug warnings would be ideal for my uses; however supporting this kind of config in the package.json would be awesome as well.
Webpack config is an executed .js - so it doesn't lend itself to fitting neatly in other toolchains.
Environment variables however would allow for more freedom to control the output when running in a Continuous Integration server, in 3rd party tools, or docker-based build chains.
In the case described regarding Create React App, could this be solved by letting you define a webpack overrides key in package.json?
So you could access noParse and possibly other needed overrides?
Idk, I might be making too many assumptions about CRA's config & usage of webpack.
Has this been discussed? Move this over to Create React App issues?
My original issue wouldn't be solved. My use case is I'm trying to combine code from several teams into a single product w/o me materially changing anything.
My access is limited to the CI server & it's build env vars.
Activity
sokra commentedon Feb 12, 2017
An option to suppress warnings make sense.
sokra commentedon Feb 12, 2017
Maybe:
bebraw commentedon Feb 12, 2017
I might put it below
outputso that you would end up withoutput.supressWarnings.kill eslint complaint about whitespace in regex
justsml commentedon Feb 21, 2017
@sokra 👍
I really like this pattern.
@bebraw However, don't add it to
output- it confuses the purpose of that configuration object.While it sounds right at first, on second thought I feel this feature deals more with console output - not chunking/hashing/building
output.justsml commentedon Feb 21, 2017
And as @gaearon points out, it'd need to be external to the normal build configuration...
An environment value to optionally turn ON debug warnings would be ideal for my uses; however supporting this kind of config in the
package.jsonwould be awesome as well.@sokra is that kinda what you were thinking?
gaearon commentedon Feb 21, 2017
In my case, I'm fine with this being in configuration because I as a tool-maker can set it up.
justsml commentedon Feb 21, 2017
@gaearon - I guess I should clarify - which configuration?
webpack.js or package.json or?
gaearon commentedon Feb 21, 2017
I have full access to a regular Webpack config, but people using my package (that builds on top of Webpack) don't.
justsml commentedon Feb 21, 2017
Webpack config is an executed
.js- so it doesn't lend itself to fitting neatly in other toolchains.Environment variables however would allow for more freedom to control the output when running in a Continuous Integration server, in 3rd party tools, or docker-based build chains.
justsml commentedon Feb 21, 2017
In the case described regarding Create React App, could this be solved by letting you define a
webpackoverrides key in package.json?So you could access
noParseand possibly other needed overrides?Idk, I might be making too many assumptions about CRA's config & usage of webpack.
Has this been discussed? Move this over to Create React App issues?
My original issue wouldn't be solved. My use case is I'm trying to combine code from several teams into a single product w/o me materially changing anything.
My access is limited to the CI server & it's build env vars.
sokra commentedon Feb 21, 2017
It will be in configuration. CRA can decide if they expose it as environment variable. I don't think this is needed but feel free to expose it.