-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
babel-preset-react-app: Allow passing options #835
Conversation
Any options are passed to babel-preset-latest Example use case: using native import support ``` "presets": [ ["react-app", {"es2015": {"modules": false}}] ] ```
FYI if you need to support Babel < 6.13, this will be a breaking change. If that is a concern, you can look at the approach we used for |
Looks like react-app depends on babel-runtime 6.11. Were there any breaking On Mon, Oct 3, 2016 at 7:57 PM Logan Smyth notifications@github.com wrote:
|
@wmertens There just hasn't been a Babel only releases packages that had changes on each release, but the versions are globally synchronized in the babel/babel repository. |
Maybe I'm just paranoid, and these count as either implementation details or bugs, but it could be good to explicitly depend on If you need to transform spread on function parameters (
|
@wmertens It wouldn't be the |
Thanks for the PR but I think we'll punt on having options for now. We intentionally want to limit the number of permutations to limit the surface area for bugs and incompatibilities. This preset is not meant to be flexible. We will eventually (probably after Webpack 2 is out of beta) remove CommonJS from it and bump the major. |
I understand, I thought as much but could only try :) On Tue, Oct 4, 2016 at 10:44 AM Dan Abramov notifications@github.com
|
@wmertens for what it's worth, in the meantime I "hacked" it like that:
and passed this preset to my webpack config only for production ;) |
@maiis ah yes of course, that's simple enough to maintain for now, thanks! I put it in my .babelrc as the path to a file containing const config = require('babel-preset-react-app')
config.presets[0] = [config.presets[0], {es2015: {modules: false}}]
module.exports = config |
Note for future readers: this is fragile and not officially supported, may break in any release. |
Any options are passed to babel-preset-latest
Example use case: using native import support