Skip to content

Commit d0fc718

Browse files
committed
add "babel-plugin-transform-decorators-legacy": "^1.3.4"
1 parent 8ce6560 commit d0fc718

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

Diff for: packages/react-scripts/config/webpack.config.dev.js

+5
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,11 @@ module.exports = {
192192
// @remove-on-eject-begin
193193
babelrc: false,
194194
presets: [require.resolve('babel-preset-react-app')],
195+
plugins: [
196+
// require.resolve('babel-plugin-transform-class-properties'),
197+
// this enables decorators
198+
require.resolve('babel-plugin-transform-decorators-legacy'),
199+
],
195200
// @remove-on-eject-end
196201
// This is a feature of `babel-loader` for webpack (not Babel itself).
197202
// It enables caching results in ./node_modules/.cache/babel-loader/

Diff for: packages/react-scripts/config/webpack.config.prod.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,15 @@ module.exports = {
189189
// @remove-on-eject-begin
190190
options: {
191191
babelrc: false,
192-
presets: [require.resolve('babel-preset-react-app')],
192+
presets: [
193+
require.resolve('babel-preset-react-app'),
194+
// this might be needed if babel-preset-react-app is missing new features we use
195+
// require.resolve('babel-preset-stage-2')
196+
],
197+
plugins: [
198+
// this enables decorators
199+
require.resolve('babel-plugin-transform-decorators-legacy'),
200+
],
193201
},
194202
// @remove-on-eject-end
195203
},

Diff for: packages/react-scripts/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"babel-eslint": "7.2.3",
2727
"babel-jest": "20.0.3",
2828
"babel-loader": "7.0.0",
29+
"babel-plugin-transform-decorators-legacy": "^1.3.4",
2930
"babel-preset-react-app": "^3.0.0",
3031
"babel-runtime": "6.23.0",
3132
"case-sensitive-paths-webpack-plugin": "1.1.4",

0 commit comments

Comments
 (0)