File tree Expand file tree Collapse file tree 4 files changed +9
-4
lines changed Expand file tree Collapse file tree 4 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ export function CustomComponentTransformer(ctx: Context): Transform {
12
12
} ,
13
13
transform ( { code, path } ) {
14
14
const filepath = ctx . normalizePath ( path )
15
- const componentNames = Array . from ( code . matchAll ( / _ r e s o l v e C o m p o n e n t \( " ( .* ) " \) / g) ) . map ( i => normalize ( i [ 1 ] ) )
16
15
16
+ const componentNames = Array . from ( code . matchAll ( / _ r e s o l v e C o m p o n e n t \( " ( .* ) " \) / g) ) . map ( i => normalize ( i [ 1 ] ) )
17
17
const entry = code . match ( / e x p o r t d e f a u l t ( [ a - z A - Z _ $ 0 - 9 ] + ) ; / ) ?. [ 1 ]
18
18
19
19
if ( ! entry ) {
Original file line number Diff line number Diff line change @@ -14,7 +14,9 @@ const debug = Debug('vite-plugin-components:transform:script')
14
14
export function VueScriptTransformer ( ctx : Context ) : Transform {
15
15
return {
16
16
test ( { path, query } ) {
17
- return path . endsWith ( '.vue' ) && ! query . type
17
+ return ! path . startsWith ( '/@' )
18
+ && path . endsWith ( '.vue' )
19
+ && ! query . type
18
20
} ,
19
21
transform ( { code, path, isBuild } ) {
20
22
const filepath = ctx . normalizePath ( ctx . relative ( path ) )
Original file line number Diff line number Diff line change @@ -8,7 +8,8 @@ const debug = Debug('vite-plugin-components:transform:script-setup')
8
8
export function VueScriptSetupTransformer ( ctx : Context ) : Transform {
9
9
return {
10
10
test ( { path, query } ) {
11
- return path . endsWith ( '.vue' )
11
+ return ! path . startsWith ( '/@' )
12
+ && path . endsWith ( '.vue' )
12
13
&& query . type === 'script'
13
14
&& ( Boolean ( query . setup ) || query . setup === '' )
14
15
} ,
Original file line number Diff line number Diff line change @@ -14,7 +14,9 @@ const debug = Debug('vite-plugin-components:transform:template')
14
14
export function VueTemplateTransformer ( ctx : Context ) : Transform {
15
15
return {
16
16
test ( { path, query } ) {
17
- return path . endsWith ( '.vue' ) && query . type === 'template'
17
+ return ! path . startsWith ( '/@' )
18
+ && path . endsWith ( '.vue' )
19
+ && query . type === 'template'
18
20
} ,
19
21
transform ( { code, path } ) {
20
22
const filepath = ctx . normalizePath ( path )
You can’t perform that action at this time.
0 commit comments