File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ export const unpluginFactory: UnpluginFactory<Options> = (options = {}) => {
23
23
transformInclude ( id ) {
24
24
const { file, isSfc, query } = parse_ID ( id ) ;
25
25
26
- if ( filter ( file ) ) {
26
+ if ( query . raw == null && filter ( file ) ) {
27
27
if ( isSfc && query . type !== 'template' ) {
28
28
return (
29
29
// vite-plugin-vue
Original file line number Diff line number Diff line change @@ -3,24 +3,27 @@ import { TRACE_ID } from './constants';
3
3
4
4
export interface VueQuery extends Record < string , any > {
5
5
type ?: 'script' | 'template' | 'style' | 'custom' ;
6
+ raw ?: string ;
6
7
[ TRACE_ID ] ?: string ;
7
8
}
8
9
9
10
export function parse_ID ( id : string , root = '' ) {
10
11
const [ file , rawQuery ] = id . split ( '?' , 2 ) ;
11
12
const ext = extname ( file ) . slice ( 1 ) ;
13
+ const query = Object . fromEntries ( new URLSearchParams ( rawQuery ) ) as VueQuery ;
12
14
13
15
if ( ext === 'vue' ) {
14
16
return {
15
17
file : file . replace ( root , '' ) ,
16
18
isSfc : true ,
17
- query : Object . fromEntries ( new URLSearchParams ( rawQuery ) ) as VueQuery ,
19
+ query,
18
20
} ;
19
21
}
20
22
21
23
return {
22
24
file : file . replace ( root , '' ) ,
23
25
isJsx : true ,
24
26
isTsx : ext . includes ( 'ts' ) ,
27
+ query,
25
28
} ;
26
29
}
You can’t perform that action at this time.
0 commit comments