From 4a4106ba457f39e2db7f9f43cb0e3d8cfa6d0d38 Mon Sep 17 00:00:00 2001 From: dan Date: Tue, 31 Oct 2023 00:59:00 +0000 Subject: [PATCH] Don't inline-require Babel runtime helpers (#1774) --- patches/babel-preset-fbjs+3.4.0.patch | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 patches/babel-preset-fbjs+3.4.0.patch diff --git a/patches/babel-preset-fbjs+3.4.0.patch b/patches/babel-preset-fbjs+3.4.0.patch new file mode 100644 index 00000000..a66f7c7d --- /dev/null +++ b/patches/babel-preset-fbjs+3.4.0.patch @@ -0,0 +1,12 @@ +diff --git a/node_modules/babel-preset-fbjs/plugins/inline-requires.js b/node_modules/babel-preset-fbjs/plugins/inline-requires.js +index b11fc83..e18661a 100644 +--- a/node_modules/babel-preset-fbjs/plugins/inline-requires.js ++++ b/node_modules/babel-preset-fbjs/plugins/inline-requires.js +@@ -256,6 +256,7 @@ function getInlineableModule(path, state) { + + return moduleName == null || + state.ignoredRequires.has(moduleName) || ++ moduleName.startsWith('@babel/runtime/') || + isRequireInScope + ? null + : { moduleName, requireFnName: fnName };