Skip to content

Commit

Permalink
add "babel-plugin-transform-decorators-legacy": "^1.3.4"
Browse files Browse the repository at this point in the history
  • Loading branch information
zangrafx committed May 31, 2017
1 parent 8ce6560 commit d0fc718
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/react-scripts/config/webpack.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ module.exports = {
// @remove-on-eject-begin
babelrc: false,
presets: [require.resolve('babel-preset-react-app')],
plugins: [
// require.resolve('babel-plugin-transform-class-properties'),
// this enables decorators
require.resolve('babel-plugin-transform-decorators-legacy'),
],
// @remove-on-eject-end
// This is a feature of `babel-loader` for webpack (not Babel itself).
// It enables caching results in ./node_modules/.cache/babel-loader/
Expand Down
10 changes: 9 additions & 1 deletion packages/react-scripts/config/webpack.config.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,15 @@ module.exports = {
// @remove-on-eject-begin
options: {
babelrc: false,
presets: [require.resolve('babel-preset-react-app')],
presets: [
require.resolve('babel-preset-react-app'),
// this might be needed if babel-preset-react-app is missing new features we use
// require.resolve('babel-preset-stage-2')
],
plugins: [
// this enables decorators
require.resolve('babel-plugin-transform-decorators-legacy'),
],
},
// @remove-on-eject-end
},
Expand Down
1 change: 1 addition & 0 deletions packages/react-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"babel-eslint": "7.2.3",
"babel-jest": "20.0.3",
"babel-loader": "7.0.0",
"babel-plugin-transform-decorators-legacy": "^1.3.4",
"babel-preset-react-app": "^3.0.0",
"babel-runtime": "6.23.0",
"case-sensitive-paths-webpack-plugin": "1.1.4",
Expand Down

0 comments on commit d0fc718

Please sign in to comment.