Skip to content

Commit b7b547b

Browse files
authored
fix: account for spaces when extracting components and directives (#348)
1 parent d57e3c7 commit b7b547b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/shared/src/imports/parseTemplate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { camelize, capitalize } from 'vue'
22

33
export function parseTemplate (source: string) {
4-
const components = createSet(source.matchAll(/(?:var|const) (\w+) = _resolveComponent\("([\w-.]+)"\);?/gm))
5-
const directives = createSet(source.matchAll(/(?:var|const) (\w+) = _resolveDirective\("([\w-.]+)"\);?/gm))
4+
const components = createSet(source.matchAll(/(?:var|const) (\w+) *?= *?_resolveComponent\("([\w-.]+)"\);?/gm))
5+
const directives = createSet(source.matchAll(/(?:var|const) (\w+) *?= *?_resolveDirective\("([\w-.]+)"\);?/gm))
66

77
return { components, directives }
88
}

0 commit comments

Comments
 (0)