mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-29 01:45:40 +08:00
Remove unnecessary transform plugins for object spread to work (#1052)
* Update `babel-plugin-transform-object-rest-spread` to v6.19.0 The `babel-plugin-transform-object-rest-spread` v6.19.0 update will allow us to remove the `babel-plugin-transform-es2015-destructuring` and `babel-plugin-transform-es2015-parameters` as the object rest spread transform will now work standalone and not require additional tranforms * Remove unnecessary babel transform plugins from babel-preset-react-app The `babel-plugin-transform-object-rest-spread` v6.19.0 update makes these plugins unnecessary, as v6.19.0 can be used stand-alone
This commit is contained in:
@@ -27,15 +27,7 @@ const plugins = [
|
||||
regenerator: true,
|
||||
// Resolve the Babel runtime relative to the config.
|
||||
moduleName: path.dirname(require.resolve('babel-runtime/package'))
|
||||
}],
|
||||
// The following two plugins are currently necessary to get
|
||||
// babel-preset-env to work with rest/spread. More info here:
|
||||
// https://github.com/babel/babel-preset-env#caveats
|
||||
// https://github.com/babel/babel/issues/4074
|
||||
// const { a, ...z } = obj;
|
||||
require.resolve('babel-plugin-transform-es2015-destructuring'),
|
||||
// const fn = ({ a, ...otherProps }) => otherProps;
|
||||
require.resolve('babel-plugin-transform-es2015-parameters')
|
||||
}]
|
||||
];
|
||||
|
||||
// This is similar to how `env` works in Babel:
|
||||
|
||||
@@ -12,9 +12,7 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"babel-plugin-transform-class-properties": "6.16.0",
|
||||
"babel-plugin-transform-es2015-destructuring": "6.16.0",
|
||||
"babel-plugin-transform-es2015-parameters": "6.17.0",
|
||||
"babel-plugin-transform-object-rest-spread": "6.16.0",
|
||||
"babel-plugin-transform-object-rest-spread": "6.19.0",
|
||||
"babel-plugin-transform-react-constant-elements": "6.9.1",
|
||||
"babel-plugin-transform-react-jsx-self": "6.11.0",
|
||||
"babel-plugin-transform-react-jsx-source": "6.9.0",
|
||||
|
||||
Reference in New Issue
Block a user