From 3a93d5d6f1ed52e7f1caf968c135a569a4c1758e Mon Sep 17 00:00:00 2001 From: clchenliang Date: Mon, 24 Nov 2025 19:43:18 +0800 Subject: [PATCH 1/3] fix: should minify the match string --- packages/runtime/plugin-runtime/src/document/cli/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/runtime/plugin-runtime/src/document/cli/index.ts b/packages/runtime/plugin-runtime/src/document/cli/index.ts index 4af96bfaa215..4cbdcb494b9b 100644 --- a/packages/runtime/plugin-runtime/src/document/cli/index.ts +++ b/packages/runtime/plugin-runtime/src/document/cli/index.ts @@ -251,7 +251,7 @@ export const documentPlugin = (): CliPluginFuture> => ({ html = html.replace( new RegExp( - `${DOCUMENT_SCRIPT_PLACEHOLDER_START}${DOCUMENT_SCRIPT_ATTRIBUTES_START}(.*)${DOCUMENT_SCRIPT_ATTRIBUTES_END}(.*?)${DOCUMENT_SCRIPT_PLACEHOLDER_END}`, + `${DOCUMENT_SCRIPT_PLACEHOLDER_START}${DOCUMENT_SCRIPT_ATTRIBUTES_START}(.*?)${DOCUMENT_SCRIPT_ATTRIBUTES_END}(.*?)${DOCUMENT_SCRIPT_PLACEHOLDER_END}`, 'g', ), (_scriptStr, $1, $2) => From a601ba0cc7b13e17e2126beb0c3bdfe70869df9d Mon Sep 17 00:00:00 2001 From: clchenliang Date: Mon, 24 Nov 2025 19:50:06 +0800 Subject: [PATCH 2/3] feat: add test --- .../integration/app-document/src/sub/Document.tsx | 8 ++++++++ .../integration/app-document/tests/index.test.ts | 15 +++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/tests/integration/app-document/src/sub/Document.tsx b/tests/integration/app-document/src/sub/Document.tsx index ae84f096a49d..d5f1de78a2df 100644 --- a/tests/integration/app-document/src/sub/Document.tsx +++ b/tests/integration/app-document/src/sub/Document.tsx @@ -55,6 +55,14 @@ export default function Document(): React.ReactElement { console.log('this is a IIFE function'); }} /> +