Skip to content

Commit 3ee67ba

Browse files
Merge pull request #500 from jogelin/fix-orphan-close-script-tags
fix(nf): Remove orphans `</scripts>` tags during `updateScriptTags`
2 parents 9897a1f + 7a4b3af commit 3ee67ba

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

libs/native-federation/src/utils/updateIndexHtml.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,11 @@ export function updateScriptTags(
4545
<script type="module-shim" src="${mainName}"></script>
4646
`;
4747

48-
indexContent = indexContent.replace(/<script src="polyfills.*?>/, '');
49-
indexContent = indexContent.replace(/<script src="main.*?>/, '');
48+
indexContent = indexContent.replace(
49+
/<script src="polyfills.*?><\/script>/,
50+
''
51+
);
52+
indexContent = indexContent.replace(/<script src="main.*?><\/script>/, '');
5053
indexContent = indexContent.replace('</body>', `${htmlFragment}</body>`);
5154
return indexContent;
5255
}

0 commit comments

Comments
 (0)