Skip to content

Commit 7a4b3af

Browse files
committed
fix(nf): Remove orphans </scripts> tags after updateScriptTags
1 parent 16630ae commit 7a4b3af

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
@@ -34,8 +34,11 @@ export function updateScriptTags(
3434
<script type="module-shim" src="${mainName}"></script>
3535
`;
3636

37-
indexContent = indexContent.replace(/<script src="polyfills.*?>/, '');
38-
indexContent = indexContent.replace(/<script src="main.*?>/, '');
37+
indexContent = indexContent.replace(
38+
/<script src="polyfills.*?><\/script>/,
39+
''
40+
);
41+
indexContent = indexContent.replace(/<script src="main.*?><\/script>/, '');
3942
indexContent = indexContent.replace('</body>', `${htmlFragment}</body>`);
4043
return indexContent;
4144
}

0 commit comments

Comments
 (0)