Skip to content

Commit 1bfd787

Browse files
LiZhequlizhequ
and
lizhequ
authored
feat: compatible with plugin-vue-jsx (#479)
Co-authored-by: lizhequ <lizhequ@ysbang.cn>
1 parent 0a9e935 commit 1bfd787

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/core/transforms/component.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ const resolveVue2 = (code: string, s: MagicString) => {
2929
const resolveVue3 = (code: string, s: MagicString) => {
3030
const results: ResolveResult[] = []
3131

32-
for (const match of code.matchAll(/_resolveComponent\("(.+?)"\)/g)) {
32+
/**
33+
* when using some plugin like plugin-vue-jsx, resolveComponent will be imported as resolveComponent1 to avoid duplicate import
34+
*/
35+
for (const match of code.matchAll(/_resolveComponent[0-9]*\("(.+?)"\)/g)) {
3336
const matchedName = match[1]
3437
if (match.index != null && matchedName && !matchedName.startsWith('_')) {
3538
const start = match.index

0 commit comments

Comments
 (0)