-
-
Notifications
You must be signed in to change notification settings - Fork 372
Respect "browserslist" config #125
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9cfbab5
respect 'browserslist' config
lukeed 834f804
fix babel: browsers-->targets.browsers
lukeed bb610e7
add “Custom Config” docs (WIP)
lukeed a83305a
derp
lukeed ff203b0
derp x2
lukeed 023a09f
3rd time's the charm
lukeed 917d769
add autoprefixer link
lukeed File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️ options.browsers - babel-config.js will be still usable as a babel preset!
However it should be:
target: { browsers: [...] }like here (I've wanted to check what this does - I still don't know, but at least I've noticed it is passed differently 😛 )There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, nice catch! Looks like that should have always been
target.browsers👍Sorry, I'm confused by your first sentence. Not sure what you mean.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just that I really dig that you pass browsers via options 😛 . That means I'll still be able to us babel-config.js as a babel preset in #56 and use it like so:
presets: [path.resolve(..., 'babel-config.js', { browsers: ... } ]There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, haha, great!
I'm thinking now, to answer my own question (below), that I need to respect any
"babel"config inside thepackage.json.With #56, how will users customize their babel options? I should account for that too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Via .babelrc or package.json (or even by changing webpack babel-loader query). I don't think you have to worry about that at all because babel is so smart that it extends over this configuration, i.e. a
.babelrcthat looks like this{ plugins: ["my-awesome-plugin"] }will get everything applied from this file + 'my-awesome-plugin'.In case of collisions stuff from .babelrc takes precedence over our internal settings (don't remember if options were merged tough, e.g. when
envpreset was declared stuff likeloose: truewas preserved or in this case browsers would be preserved)