babel-preset-react-app 2.0.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/index.js +39 -28
- package/package.json +12 -13
package/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# babel-preset-react-app
|
2
2
|
|
3
|
-
This package includes the Babel preset used by [Create React App](https://github.com/facebookincubator/create-react-app)
|
3
|
+
This package includes the Babel preset used by [Create React App](https://github.com/facebookincubator/create-react-app).<br>
|
4
4
|
Please refer to its documentation:
|
5
5
|
|
6
6
|
* [Getting Started](https://github.com/facebookincubator/create-react-app/blob/master/README.md#getting-started) – How to create a new app.
|
package/index.js
CHANGED
@@ -11,32 +11,27 @@
|
|
11
11
|
var path = require('path');
|
12
12
|
|
13
13
|
const plugins = [
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
//
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
regenerator: true,
|
36
|
-
// Resolve the Babel runtime relative to the config.
|
37
|
-
moduleName: path.dirname(require.resolve('babel-runtime/package'))
|
38
|
-
}]
|
39
|
-
];
|
14
|
+
// class { handleClick = () => { } }
|
15
|
+
require.resolve('babel-plugin-transform-class-properties'),
|
16
|
+
// The following two plugins use Object.assign directly, instead of Babel's
|
17
|
+
// extends helper. Note that this assumes `Object.assign` is available.
|
18
|
+
// { ...todo, completed: true }
|
19
|
+
[require.resolve('babel-plugin-transform-object-rest-spread'), {
|
20
|
+
useBuiltIns: true
|
21
|
+
}],
|
22
|
+
// Transforms JSX
|
23
|
+
[require.resolve('babel-plugin-transform-react-jsx'), {
|
24
|
+
useBuiltIns: true
|
25
|
+
}],
|
26
|
+
// Polyfills the runtime needed for async/await and generators
|
27
|
+
[require.resolve('babel-plugin-transform-runtime'), {
|
28
|
+
helpers: false,
|
29
|
+
polyfill: false,
|
30
|
+
regenerator: true,
|
31
|
+
// Resolve the Babel runtime relative to the config.
|
32
|
+
moduleName: path.dirname(require.resolve('babel-runtime/package'))
|
33
|
+
}]
|
34
|
+
];
|
40
35
|
|
41
36
|
// This is similar to how `env` works in Babel:
|
42
37
|
// https://babeljs.io/docs/usage/babelrc/#env-option
|
@@ -86,11 +81,27 @@ if (env === 'test') {
|
|
86
81
|
module.exports = {
|
87
82
|
presets: [
|
88
83
|
// Latest stable ECMAScript features
|
89
|
-
require.resolve('babel-preset-
|
84
|
+
[require.resolve('babel-preset-env'), {
|
85
|
+
targets: {
|
86
|
+
// React parses on ie 9, so we should too
|
87
|
+
ie: 9,
|
88
|
+
// We currently minify with uglify
|
89
|
+
// Remove after https://github.com/mishoo/UglifyJS2/issues/448
|
90
|
+
uglify: true
|
91
|
+
},
|
92
|
+
// Disable polyfill transforms
|
93
|
+
useBuiltIns: false
|
94
|
+
}],
|
90
95
|
// JSX, Flow
|
91
96
|
require.resolve('babel-preset-react')
|
92
97
|
],
|
93
|
-
plugins: plugins
|
98
|
+
plugins: plugins.concat([
|
99
|
+
// function* () { yield 42; yield 43; }
|
100
|
+
[require.resolve('babel-plugin-transform-regenerator'), {
|
101
|
+
// Async functions are converted to generators by babel-preset-latest
|
102
|
+
async: false
|
103
|
+
}],
|
104
|
+
])
|
94
105
|
};
|
95
106
|
|
96
107
|
if (env === 'production') {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "babel-preset-react-app",
|
3
|
-
"version": "2.
|
3
|
+
"version": "2.2.0",
|
4
4
|
"description": "Babel preset used by Create React App",
|
5
5
|
"repository": "facebookincubator/create-react-app",
|
6
6
|
"license": "BSD-3-Clause",
|
@@ -11,17 +11,16 @@
|
|
11
11
|
"index.js"
|
12
12
|
],
|
13
13
|
"dependencies": {
|
14
|
-
"babel-plugin-transform-class-properties": "6.
|
15
|
-
"babel-plugin-transform-object-rest-spread": "6.
|
16
|
-
"babel-plugin-transform-react-constant-elements": "6.
|
17
|
-
"babel-plugin-transform-react-jsx": "6.
|
18
|
-
"babel-plugin-transform-react-jsx-self": "6.
|
19
|
-
"babel-plugin-transform-react-jsx-source": "6.
|
20
|
-
"babel-plugin-transform-regenerator": "6.
|
21
|
-
"babel-plugin-transform-runtime": "6.
|
22
|
-
"babel-preset-env": "
|
23
|
-
"babel-preset-
|
24
|
-
"babel-
|
25
|
-
"babel-runtime": "6.11.6"
|
14
|
+
"babel-plugin-transform-class-properties": "6.22.0",
|
15
|
+
"babel-plugin-transform-object-rest-spread": "6.22.0",
|
16
|
+
"babel-plugin-transform-react-constant-elements": "6.22.0",
|
17
|
+
"babel-plugin-transform-react-jsx": "6.22.0",
|
18
|
+
"babel-plugin-transform-react-jsx-self": "6.22.0",
|
19
|
+
"babel-plugin-transform-react-jsx-source": "6.22.0",
|
20
|
+
"babel-plugin-transform-regenerator": "6.22.0",
|
21
|
+
"babel-plugin-transform-runtime": "6.22.0",
|
22
|
+
"babel-preset-env": "1.2.1",
|
23
|
+
"babel-preset-react": "6.22.0",
|
24
|
+
"babel-runtime": "6.22.0"
|
26
25
|
}
|
27
26
|
}
|