From 8f1ec1c95de604f901cf788b8b5842fb22403a31 Mon Sep 17 00:00:00 2001 From: Seyyed Morteza Moosavi Date: Tue, 25 Dec 2018 14:18:05 +0330 Subject: [PATCH] update monkey-react-scripts --- .babelrc | 10 ++++++++++ package.json | 2 +- webpack-helpers/babelPatch.js | 7 ++----- yarn.lock | 8 ++++---- 4 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 .babelrc diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..807b0d8 --- /dev/null +++ b/.babelrc @@ -0,0 +1,10 @@ +{ + "plugins": [ + [ + "@babel/plugin-proposal-decorators", + { + "legacy": true + } + ] + ] +} \ No newline at end of file diff --git a/package.json b/package.json index a06e19b..799eabd 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "private": true, "dependencies": { "@babel/plugin-proposal-decorators": "^7.1.0", - "monkey-react-scripts": "^0.1.4", + "monkey-react-scripts": "^0.2.0", "node-sass": "^4.9.3", "postcss-inline-rtl": "^0.9.8", "react": "^16.5.2", diff --git a/webpack-helpers/babelPatch.js b/webpack-helpers/babelPatch.js index 2a8c8df..423b38f 100644 --- a/webpack-helpers/babelPatch.js +++ b/webpack-helpers/babelPatch.js @@ -5,9 +5,6 @@ module.exports.babelPatch = function babelPatch(webpackConfig, isDevelopment) { const babelRule = findRule(webpackConfig, (rule) => { return ('' + rule.test === '' + /\.(js|mjs|jsx|ts|tsx)$/) }); - const plugins = babelRule.options.plugins || []; - babelRule.options.plugins = [ - ...plugins, - ["@babel/plugin-proposal-decorators", {legacy: true}], - ] + + babelRule.options.babelrc = true }; diff --git a/yarn.lock b/yarn.lock index d2800d5..fca7b42 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6558,10 +6558,10 @@ mkdirp@0.5.1, mkdirp@0.5.x, "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdi dependencies: minimist "0.0.8" -monkey-react-scripts@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/monkey-react-scripts/-/monkey-react-scripts-0.1.4.tgz#4eeb0c388a1628c038783bcd38f43b5d21e5ea6c" - integrity sha512-NZwTpl8IA1lDAAY6t8K/UW/Bi0y+T3/z9R0BcNuWSd8wBi9VdtnMno8zclyr4JDvyTLq0n7sR4ZTpNLZKotRpA== +monkey-react-scripts@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/monkey-react-scripts/-/monkey-react-scripts-0.2.0.tgz#dcb8029a7ff6fa4cd5dceb66664ff61ccef94321" + integrity sha512-hvAEe5gpjf3qgx0meSsRQCvdWlsub8H/G4nSf/SOYKyW68PBHzZ7SdIYcf2rGVFPMi4zu3gdhvg+CxKuTFa9PQ== dependencies: react-dev-utils "^5.0.0"