Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit6c03a9b

Browse files
fix(vite): support jsx namespaces (#3539)
Babel throws when encountering jsx namespaces by default. It needs asetting to not throw.
1 parenta2c9350 commit6c03a9b

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
exportdefaultfunctionPage(){
2+
return(
3+
<svg
4+
xmlns="http://www.w3.org/2000/svg"
5+
xml:space="preserve"
6+
>
7+
</svg>
8+
);
9+
}

‎packages/plugin-vite/src/plugins/deno.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ function babelTransform(
375375
runtime:"automatic",
376376
importSource:"preact",
377377
development:isDev,
378+
throwIfNamespace:false,
378379
}]);
379380
}
380381

‎packages/plugin-vite/src/plugins/patches.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export function patches(): Plugin {
3333
runtime:"automatic",
3434
importSource:"preact",
3535
development:isDev,
36+
throwIfNamespace:false,
3637
}]);
3738
}
3839

‎packages/plugin-vite/tests/dev_server_test.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,3 +490,14 @@ Deno.test({
490490
sanitizeOps:false,
491491
sanitizeResources:false,
492492
});
493+
494+
Deno.test({
495+
name:"vite dev - support jsx namespace",
496+
fn:async()=>{
497+
constres=awaitfetch(`${demoServer.address()}/tests/jsx_namespace`);
498+
consttext=awaitres.text();
499+
expect(text).toContain(`xml:space="preserve"`);
500+
},
501+
sanitizeOps:false,
502+
sanitizeResources:false,
503+
});

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp