Skip to content

Commit

Permalink
fix: remove space between number and prop
Browse files Browse the repository at this point in the history
  • Loading branch information
KawaiiZapic committed Mar 27, 2024
1 parent e3dc824 commit 48896c8
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions plugins/Matecho.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,14 @@ export default (): Plugin => {
if (!isWrite) return;
for (const key of Object.keys(bundle)) {
const OutputBundle = bundle[key];
if (!("code" in OutputBundle)) continue;
if (
key.endsWith(".js") &&
OutputBundle.code?.includes("/__VIRTUAL_THEME_ROOT__/")
) {
OutputBundle.code = OutputBundle.code.replaceAll(
if (!("code" in OutputBundle) || !key.endsWith(".js")) continue;
OutputBundle.code = OutputBundle.code
.replaceAll(
'"/__VIRTUAL_THEME_ROOT__/"',
" window.__MATECHO_THEME_ROOT__"
);
}
)
// Some CDN will compress this space, that will cause syntax error, fill with dot to prevent this
.replaceAll("1 .toString", "1..toString");
}
},
writeBundle(opt, bundle) {
Expand Down

0 comments on commit 48896c8

Please sign in to comment.