Add support for ignoring native browserslist resolution #585
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #411
Consider a scenario where a project contains code destined for NodeJS except for the
src
directory which is for browsers. The project has the following browserslist config:We want
compat/compat
to use the "node" env for everything except thesrc
directory, and "production" (browserslist default env) withinsrc
. This is currently not possible since additional targets are always merged with browserslist-resolved targets (when config is present).This change adds support for a new options structure (with full BC):
Setting
ignoreBrowserslistTargets: true
will prevent merging targets provided inquery
with the ones resolved by browserslist.We can now do something like this:
The targets defined in the "node" browserslist environment will now be used everywhere in the project except within the
src
directory where the "production" environment will be used instead.