babel-preset-react-app-new 0.0.3 → 1.0.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/create.js +2 -79
- package/dependencies.js +0 -25
- package/package.json +8 -18
package/create.js
CHANGED
|
@@ -97,68 +97,8 @@ module.exports = function (api, opts, env) {
|
|
|
97
97
|
isTypeScriptEnabled && [require('@babel/preset-typescript').default]
|
|
98
98
|
].filter(Boolean),
|
|
99
99
|
plugins: [
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
// https://github.com/facebook/create-react-app/pull/5182
|
|
103
|
-
// We will conditionally enable this plugin below in overrides as it clashes with
|
|
104
|
-
// @babel/plugin-proposal-decorators when using TypeScript.
|
|
105
|
-
// https://github.com/facebook/create-react-app/issues/5741
|
|
106
|
-
isFlowEnabled && [require('@babel/plugin-transform-flow-strip-types').default, false],
|
|
107
|
-
// Experimental macros support. Will be documented after it's had some time
|
|
108
|
-
// in the wild.
|
|
109
|
-
require('babel-plugin-macros'),
|
|
110
|
-
// Disabled as it's handled automatically by preset-env, and `selectiveLoose` isn't
|
|
111
|
-
// yet merged into babel: https://github.com/babel/babel/pull/9486
|
|
112
|
-
// Related: https://github.com/facebook/create-react-app/pull/8215
|
|
113
|
-
// [
|
|
114
|
-
// require('@babel/plugin-transform-destructuring').default,
|
|
115
|
-
// {
|
|
116
|
-
// // Use loose mode for performance:
|
|
117
|
-
// // https://github.com/facebook/create-react-app/issues/5602
|
|
118
|
-
// loose: false,
|
|
119
|
-
// selectiveLoose: [
|
|
120
|
-
// 'useState',
|
|
121
|
-
// 'useEffect',
|
|
122
|
-
// 'useContext',
|
|
123
|
-
// 'useReducer',
|
|
124
|
-
// 'useCallback',
|
|
125
|
-
// 'useMemo',
|
|
126
|
-
// 'useRef',
|
|
127
|
-
// 'useImperativeHandle',
|
|
128
|
-
// 'useLayoutEffect',
|
|
129
|
-
// 'useDebugValue',
|
|
130
|
-
// ],
|
|
131
|
-
// },
|
|
132
|
-
// ],
|
|
133
|
-
// Turn on legacy decorators for TypeScript files
|
|
134
|
-
isTypeScriptEnabled && [require('@babel/plugin-proposal-decorators').default, false],
|
|
135
|
-
// class { handleClick = () => { } }
|
|
136
|
-
// Enable loose mode to use assignment instead of defineProperty
|
|
137
|
-
// See discussion in https://github.com/facebook/create-react-app/issues/4263
|
|
138
|
-
// Note:
|
|
139
|
-
// 'loose' mode configuration must be the same for
|
|
140
|
-
// * @babel/plugin-proposal-class-properties
|
|
141
|
-
// * @babel/plugin-proposal-private-methods
|
|
142
|
-
// * @babel/plugin-proposal-private-property-in-object
|
|
143
|
-
// (when they are enabled)
|
|
144
|
-
[
|
|
145
|
-
require('@babel/plugin-proposal-class-properties').default,
|
|
146
|
-
{
|
|
147
|
-
loose: true
|
|
148
|
-
}
|
|
149
|
-
],
|
|
150
|
-
[
|
|
151
|
-
require('@babel/plugin-proposal-private-methods').default,
|
|
152
|
-
{
|
|
153
|
-
loose: true
|
|
154
|
-
}
|
|
155
|
-
],
|
|
156
|
-
[
|
|
157
|
-
require('@babel/plugin-proposal-private-property-in-object').default,
|
|
158
|
-
{
|
|
159
|
-
loose: true
|
|
160
|
-
}
|
|
161
|
-
],
|
|
100
|
+
[require('@babel/plugin-proposal-decorators').default, { legacy: true }],
|
|
101
|
+
|
|
162
102
|
// Polyfills the runtime needed for async/await, generators, and friends
|
|
163
103
|
// https://babeljs.io/docs/en/babel-plugin-transform-runtime
|
|
164
104
|
[
|
|
@@ -180,24 +120,7 @@ module.exports = function (api, opts, env) {
|
|
|
180
120
|
// https://github.com/babel/babel/blob/090c364a90fe73d36a30707fc612ce037bdbbb24/packages/babel-plugin-transform-runtime/src/index.js#L35-L42
|
|
181
121
|
absoluteRuntime: absoluteRuntimePath
|
|
182
122
|
}
|
|
183
|
-
],
|
|
184
|
-
isEnvProduction && [
|
|
185
|
-
// Remove PropTypes from production build
|
|
186
|
-
require('babel-plugin-transform-react-remove-prop-types').default,
|
|
187
|
-
{
|
|
188
|
-
removeImport: true
|
|
189
|
-
}
|
|
190
123
|
]
|
|
191
|
-
].filter(Boolean),
|
|
192
|
-
overrides: [
|
|
193
|
-
isFlowEnabled && {
|
|
194
|
-
exclude: /\.tsx?$/,
|
|
195
|
-
plugins: [require('@babel/plugin-transform-flow-strip-types').default]
|
|
196
|
-
},
|
|
197
|
-
isTypeScriptEnabled && {
|
|
198
|
-
test: /\.tsx?$/,
|
|
199
|
-
plugins: [[require('@babel/plugin-proposal-decorators').default, { legacy: true }]]
|
|
200
|
-
}
|
|
201
124
|
].filter(Boolean)
|
|
202
125
|
};
|
|
203
126
|
};
|
package/dependencies.js
CHANGED
|
@@ -96,31 +96,6 @@ module.exports = function (api, opts) {
|
|
|
96
96
|
]
|
|
97
97
|
].filter(Boolean),
|
|
98
98
|
plugins: [
|
|
99
|
-
// Disabled as it's handled automatically by preset-env, and `selectiveLoose` isn't
|
|
100
|
-
// yet merged into babel: https://github.com/babel/babel/pull/9486
|
|
101
|
-
// Related: https://github.com/facebook/create-react-app/pull/8215
|
|
102
|
-
// [
|
|
103
|
-
// require('@babel/plugin-transform-destructuring').default,
|
|
104
|
-
// {
|
|
105
|
-
// // Use loose mode for performance:
|
|
106
|
-
// // https://github.com/facebook/create-react-app/issues/5602
|
|
107
|
-
// loose: false,
|
|
108
|
-
// selectiveLoose: [
|
|
109
|
-
// 'useState',
|
|
110
|
-
// 'useEffect',
|
|
111
|
-
// 'useContext',
|
|
112
|
-
// 'useReducer',
|
|
113
|
-
// 'useCallback',
|
|
114
|
-
// 'useMemo',
|
|
115
|
-
// 'useRef',
|
|
116
|
-
// 'useImperativeHandle',
|
|
117
|
-
// 'useLayoutEffect',
|
|
118
|
-
// 'useDebugValue',
|
|
119
|
-
// ],
|
|
120
|
-
// },
|
|
121
|
-
// ],
|
|
122
|
-
// Polyfills the runtime needed for async/await, generators, and friends
|
|
123
|
-
// https://babeljs.io/docs/en/babel-plugin-transform-runtime
|
|
124
99
|
[
|
|
125
100
|
require('@babel/plugin-transform-runtime').default,
|
|
126
101
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "babel-preset-react-app-new",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Babel preset used by Create React App",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -21,22 +21,12 @@
|
|
|
21
21
|
"test.js"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@babel/core": "^7.
|
|
25
|
-
"@babel/plugin-proposal-
|
|
26
|
-
"@babel/plugin-
|
|
27
|
-
"@babel/
|
|
28
|
-
"@babel/
|
|
29
|
-
"@babel/
|
|
30
|
-
"@babel/
|
|
31
|
-
"@babel/plugin-proposal-private-methods": "^7.18.6",
|
|
32
|
-
"@babel/plugin-transform-flow-strip-types": "^7.22.5",
|
|
33
|
-
"@babel/plugin-transform-react-display-name": "^7.22.5",
|
|
34
|
-
"@babel/plugin-transform-runtime": "^7.22.9",
|
|
35
|
-
"@babel/preset-env": "^7.22.9",
|
|
36
|
-
"@babel/preset-react": "^7.22.5",
|
|
37
|
-
"@babel/preset-typescript": "^7.22.5",
|
|
38
|
-
"@babel/runtime": "^7.22.6",
|
|
39
|
-
"babel-plugin-macros": "^3.1.0",
|
|
40
|
-
"babel-plugin-transform-react-remove-prop-types": "^0.4.24"
|
|
24
|
+
"@babel/core": "^7.24.5",
|
|
25
|
+
"@babel/plugin-proposal-decorators": "^7.24.1",
|
|
26
|
+
"@babel/plugin-transform-runtime": "^7.24.3",
|
|
27
|
+
"@babel/preset-env": "^7.24.5",
|
|
28
|
+
"@babel/preset-react": "^7.24.1",
|
|
29
|
+
"@babel/preset-typescript": "^7.24.1",
|
|
30
|
+
"@babel/runtime": "^7.24.5"
|
|
41
31
|
}
|
|
42
32
|
}
|