-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
[v2] Refactor loading Babel to make it behave like rest of Gatsby #4298
Conversation
useBuiltIns: `usage`, | ||
sourceType: `unambiguous`, | ||
shippedProposals: true, // includes async/await and Object spread/rest | ||
targets: { browsers: browserslist }, |
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.
I learned the hard way the other day that preset-env
should always force include object-rest-spread
(https://github.com/4Catalyzer/babel-preset-4catalyzer/blob/master/index.js#L41) webpack can't handle the syntax even if the browser can.
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.
Huh, that sounds really painful to debug.
shippedProposals
does add this — perhaps we should validate user's babelrcs to make sure they've either set shippedPropsals
or that they include it directly.
i.e use Redux + new API
onCreateBabelcc
This should make understanding & using the API more fool-proof + this
PR is adding a bunch of tests where loading babelrc previously had no tests.
TODOs