Closed hzoo closed 6 years ago
Fix config in .babelrc
I know many people using a clever trick of doing {"presets": ["./.babelrc.js"]}
in .babelrc
. It would be nice to upgrade automatically those requested presets with relative paths.
Something like codemod? https://github.com/rajzshkr/babel7-upgrade
Ok closing since this is somewhat working already and we can add issues there instead. https://twitter.com/left_pad/status/965587130977275905
It would be something that would work for 90% of most users (not using babel-core directly or any crazy options), would love for the community to come together to help out with this, especially as everyone is trying to update to v7 (at least can comment on the kinds of issues you have faced to see if they can be automated).
Because most of this is json, we need a tool that handles json files.
List of packages: https://gist.github.com/hzoo/3b78b8225ffddc34483785018664390e (not all have an equivalent because they can be new for v7)
Scoped packages
"babel-core": "6.26.0" -> "@babel/core": "7.0.0-beta.31"
(support changing to the beta version or whatever is in the latest dist tag on npm).babelrc
{ "presets": ["env"] }
->{ "presets": ["@babel/env"] }
Renames
-es20xx-
prefixes from packagesbabel-plugin-transform-es2015-classes
->babel-plugin-transform-classes
transform-es3-member-expression-literals
->transform-member-expression-literals
transform-async-to-module-method
intotransform-async-to-generator
as an optionchange package json, modify babelrc.
babel-plugin-transform-class-properties
->babel-plugin-proposal-class-properties
Peer Dep on
@babel/core
This means if there wasn't a
@babel/core
at the top level, it should be added in package.json.babelrc.js
Not sure if we have to do this, not reason to change if it's not necessary.
I think if they are using the "env" key a lot we could change it. The reason why we can change the config in the first place is because it's json and not js
@babel/node
Add
@babel/node
as a dependency if they are using it in scripts.