From 1d7e338336ac2d5a08b84e11b27980b7020588fc Mon Sep 17 00:00:00 2001 From: M-ZubairAhmed Date: Fri, 19 May 2023 02:58:49 +0530 Subject: [PATCH] [MM-52787] webapp/playbooks : Remove 'babel-plugin-typescript-to-proptypes' from production (#23395) * init * modules auto --- webapp/channels/babel.config.js | 4 +--- webapp/package-lock.json | 17 ----------------- webapp/playbooks/babel.config.js | 14 +++++--------- webapp/playbooks/package.json | 1 - 4 files changed, 6 insertions(+), 30 deletions(-) diff --git a/webapp/channels/babel.config.js b/webapp/channels/babel.config.js index 35a24e8a63..ccfeb1031c 100644 --- a/webapp/channels/babel.config.js +++ b/webapp/channels/babel.config.js @@ -10,7 +10,7 @@ const config = { edge: 42, safari: 12, }, - modules: false, + modules: 'auto', corejs: 3, debug: false, useBuiltIns: 'usage', @@ -41,7 +41,6 @@ const config = { sourceType: 'unambiguous', }; -// Jest needs module transformation config.env = { test: { presets: config.presets, @@ -52,6 +51,5 @@ config.env = { plugins: config.plugins.filter((plugin) => plugin !== 'babel-plugin-typescript-to-proptypes'), }, }; -config.env.test.presets[0][1].modules = 'auto'; module.exports = config; diff --git a/webapp/package-lock.json b/webapp/package-lock.json index 2c01b78267..2ec68f8297 100644 --- a/webapp/package-lock.json +++ b/webapp/package-lock.json @@ -27562,15 +27562,6 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, - "node_modules/react-refresh": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.11.0.tgz", - "integrity": "sha512-F27qZr8uUqwhWZboondsPx8tnC3Ct3SxZA3V5WyEvujRyyNv0VYPhoBg1gZ8/MV5tubQp76Trw8lTv9hzRBa+A==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/react-router": { "version": "5.3.4", "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz", @@ -33894,7 +33885,6 @@ "jest-junit": "13.0.0", "react-beautiful-dnd": "13.1.0", "react-bootstrap": "1.6.1", - "react-refresh": "0.11.0", "react-test-renderer": "17.0.2", "redux-mock-store": "1.5.4", "redux-thunk": "2.4.1", @@ -55524,7 +55514,6 @@ "react-infinite-scroller": "1.2.6", "react-intl": "*", "react-redux": "7.2.6", - "react-refresh": "0.11.0", "react-router-dom": "5.3.4", "react-router-hash-link": "2.4.3", "react-select": "4.3.1", @@ -57542,12 +57531,6 @@ } } }, - "react-refresh": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.11.0.tgz", - "integrity": "sha512-F27qZr8uUqwhWZboondsPx8tnC3Ct3SxZA3V5WyEvujRyyNv0VYPhoBg1gZ8/MV5tubQp76Trw8lTv9hzRBa+A==", - "dev": true - }, "react-router": { "version": "5.3.4", "resolved": "https://registry.npmjs.org/react-router/-/react-router-5.3.4.tgz", diff --git a/webapp/playbooks/babel.config.js b/webapp/playbooks/babel.config.js index 87ee4d7b1c..c5fc5ba1a7 100644 --- a/webapp/playbooks/babel.config.js +++ b/webapp/playbooks/babel.config.js @@ -10,7 +10,7 @@ const config = { edge: 42, safari: 12, }, - modules: false, + modules: 'auto', corejs: 3, debug: false, useBuiltIns: 'usage', @@ -48,19 +48,15 @@ const config = { ], }; -const NPM_TARGET = process.env.npm_lifecycle_event; //eslint-disable-line no-process-env -const targetIsDevServer = NPM_TARGET === 'dev-server'; -if (targetIsDevServer) { - config.plugins.push(require.resolve('react-refresh/babel')); -} - -// Jest needs module transformation config.env = { test: { presets: config.presets, plugins: config.plugins, }, + production: { + presets: config.presets, + plugins: config.plugins.filter((plugin) => plugin !== 'babel-plugin-typescript-to-proptypes'), + }, }; -config.env.test.presets[0][1].modules = 'auto'; module.exports = config; diff --git a/webapp/playbooks/package.json b/webapp/playbooks/package.json index b8d7083a26..af864af5f5 100644 --- a/webapp/playbooks/package.json +++ b/webapp/playbooks/package.json @@ -96,7 +96,6 @@ "jest-junit": "13.0.0", "react-beautiful-dnd": "13.1.0", "react-bootstrap": "1.6.1", - "react-refresh": "0.11.0", "react-test-renderer": "17.0.2", "redux-mock-store": "1.5.4", "redux-thunk": "2.4.1",