Parcel doesn't interpret environments in a browserslist config.
Using this config
"browserslist": {
"development": ">2%, last 1 edge versions, not ie > 0, not op_mini all",
"production": ">2%, last 1 edge versions, not ie > 0, not op_mini all"
}
Results in
馃毃 <file>: Browser queries must be an array. Got object.
at browserslist (.../node_modules/browserslist/index.js:207:11)
at getTargetEngines (.../node_modules/parcel-bundler/src/utils/getTargetEngines.js:69:24)
at <anonymous>
It looks like the main browserslist(queries, opts) API that's exported isn't meant to know about environments (it's left to the user to determine which environment to supply it with).
The given config wouldn't work either with the current implementation, because the browser list props currently must be defined as an array as described in the browserlist docs. Should parcel be able to parse browserlists defined as comma separated strings too?
Ah hmm, I think that's transparent for browserlist, it probably just does a .split(',') in that case.
I guess in that case we might want to implement the string format.
@nicolaisueper perhaps you can add it to your pr?
@DeMoorJasper for sure. :)
@DeMoorJasper I added the functionality + refactored the test to cover both changes
Most helpful comment
@DeMoorJasper I added the functionality + refactored the test to cover both changes