Uh oh!
There was an error while loading. Please reload this page.
Make browsers list configurable - #2358
Conversation
…he browserslist key in package.json which allows developers to set browsers list in queries like "Chrome >= 35", "Firefox >= 38" for both production and development. Autoprefixer which relies on Browserslist will find its config automatically. This PR fixesreact#2248 and react#892
gaearon
commented
May 25, 2017
Does this let me specify |
cr101
commented
May 25, 2017
Yes. Running |
gaearon
commented
May 26, 2017
Do you think it would make sense to use a single list by default, and document splitting dev/prod in user guide? Not sure if it would be confusing to most people or not. I also think we should still provide a default for people who don't have a |
cr101
commented
May 30, 2017
@gaearon I agree that if people forget to add
A number of people have asked to split dev/prod |
I'd like to split these changes if you don't mind. Let's start with using default values when I would also like to support both single array and an object with |
…ich is no longer supported
| let supportedBrowsers = require(paths.appPackageJson).browserslist; | ||
| if (!supportedBrowsers || Object.keys(supportedBrowsers).length === 0) { | ||
| console.log( | ||
| chalk.yellow( |
There was a problem hiding this comment.
I'd like to not introduce warnings for this.
It will be a straightforward step in migration guide, but for now I don't want people to get annoyed.
Sorry, I accidentally messed up committing my changes while merging changes from upstream. |
gaearon
commented
Jun 29, 2017
Hmm. I wonder if we should count this as a breaking change or not. I guess not. |
IIRC, browserlist searches all the way up the folder tree. This might cause confusing situations if users have dangling package.jsons (something we've seen before) or malformed ones (it complains loudly when malformed). |
@Timer Any idea how to limit the browserlist search scope? |
| const paths = require('./paths'); | ||
| const getClientEnvironment = require('./env'); | ||
| // Get supported browsers list |
There was a problem hiding this comment.
I think this can be moved to a separate module to avoid DRY, maybe config/getSupportedBrowsers?
Timer
commented
Jul 2, 2017
@cr101https://github.com/ai/browserslist/blob/master/index.js#L361 looks like it can't be configured; open an issue and PR maybe? |
@Timer |
Timer
commented
Aug 3, 2017
What needs done here? |
cr101
commented
Aug 3, 2017
I don't believe so. I'm now on Windows which makes it tricky to test the changes. |
gaearon
commented
Jan 14, 2018
Really sorry about this—we were very busy with React 16 rollout and by the time we got around to reviewing #3644 was more fresh so we took it instead. Thanks for prototyping this early on! |

Autoprefixer's
browsersoption is currently hardcoded. This PR adds thebrowserslistkey inpackage.jsonwhich allows developers to set different browsers for both production and development.Autoprefixer which relies on Browserslist will find its config automatically.
This PR fixes#2248 and #892