Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update asset_copy test case snapshot, document node 14 error #3504

Merged
merged 3 commits into from
Apr 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/quiet-pets-collect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@modern-js/runtime': patch
---

fix: 更新集测 snapshot,修复 document 功能在 node 14 下的错误
fix: update test snapshot, fix document error in node 14
4 changes: 2 additions & 2 deletions packages/runtime/plugin-runtime/src/document/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export default (): CliPlugin<AppTools> => ({
html.includes(DOCUMENT_SCRIPT_PLACEHOLDER_START) &&
html.includes(DOCUMENT_SCRIPT_PLACEHOLDER_END)
) {
html = html.replaceAll(
html = html.replace(
new RegExp(
`${DOCUMENT_SCRIPT_PLACEHOLDER_START}(.*?)${DOCUMENT_SCRIPT_PLACEHOLDER_END}`,
'g',
Expand All @@ -215,7 +215,7 @@ export default (): CliPlugin<AppTools> => ({
html.includes(DOCUMENT_COMMENT_PLACEHOLDER_START) &&
html.includes(DOCUMENT_COMMENT_PLACEHOLDER_END)
) {
html = html.replaceAll(
html = html.replace(
new RegExp(
`${DOCUMENT_COMMENT_PLACEHOLDER_START}(.*?)${DOCUMENT_COMMENT_PLACEHOLDER_END}`,
'g',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`copy assets should copy public html and replace the assetPrefix variable 1`] = `
"<!DOCTYPE html>
<html>
<head>
<script>
window.__assetPrefix__ = 'https://demo.com';
window.__assetPrefix2__ = 'https://demo.com';
window.__assetPrefix3__ = 'https://demo.com';
</script>
</head>
</html>
"
`;

exports[`copy assets should copy public html and replace the assetPrefix variable in rspack 1`] = `
"<!DOCTYPE html>
<html>
Expand Down