From 6745473582e9d205afab5f11105fb2506edfc5f5 Mon Sep 17 00:00:00 2001 From: Bob Ippolito Date: Mon, 20 May 2024 06:39:23 -0700 Subject: [PATCH] [lexical-react] Bug Fix: Use automatic jsx runtime with react/jsx-runtime -> react alias in www --- scripts/build.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/build.js b/scripts/build.js index d80d5a6d1bf..a9d4193f938 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -72,6 +72,8 @@ const wwwMappings = { 'prismjs/components/prism-swift': 'prism-swift', 'prismjs/components/prism-typescript': 'prism-typescript', 'react-dom': 'ReactDOMComet', + // The react entrypoint in fb includes the jsx runtime + 'react/jsx-runtime': 'react', }; /** @@ -192,7 +194,7 @@ async function build(name, inputFile, outputPath, outputFile, isProd, format) { tsconfig: path.resolve('./tsconfig.build.json'), }, ], - ['@babel/preset-react', {runtime: isWWW ? 'classic' : 'automatic'}], + ['@babel/preset-react', {runtime: 'automatic'}], ], }), {