Skip to content

Commit 1bfd787

Browse files
LiZhequlizhequ
andauthored
feat: compatible with plugin-vue-jsx (unplugin#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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy