File tree Expand file tree Collapse file tree 4 files changed +22
-2
lines changed Expand file tree Collapse file tree 4 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,10 @@ import type {
9
9
} from 'vue/compiler-sfc'
10
10
import type * as _compiler from 'vue/compiler-sfc'
11
11
import { computed , shallowRef } from 'vue'
12
- import { exactRegex } from '@rolldown/pluginutils'
12
+ import {
13
+ exactRegex ,
14
+ makeIdFiltersToMatchWithQuery ,
15
+ } from '@rolldown/pluginutils'
13
16
import { version } from '../package.json'
14
17
import { resolveCompiler } from './compiler'
15
18
import { parseVueRequest } from './utils/query'
@@ -358,7 +361,10 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin<Api> {
358
361
optionsHookIsCalled = true
359
362
; ( plugin . transform as TransformObjectHook ) . filter = {
360
363
id : {
361
- include : [ ...ensureArray ( include . value ) , / [ ? & ] v u e \b / ] ,
364
+ include : [
365
+ ...makeIdFiltersToMatchWithQuery ( ensureArray ( include . value ) ) ,
366
+ / [ ? & ] v u e \b / ,
367
+ ] ,
362
368
exclude : exclude . value ,
363
369
} ,
364
370
}
Original file line number Diff line number Diff line change 11
11
<HmrCircularReference name =" test" />
12
12
<TypeProps msg =" msg" bar =" bar" :id =" 123" />
13
13
<TypePropsTsx msg =" msg" bar =" bar" />
14
+ <WithQuery />
14
15
<Syntax />
15
16
<PreProcessors />
16
17
<PreProcessorsHmr />
44
45
import { version , defineAsyncComponent } from ' vue'
45
46
import Hmr from ' ./Hmr.vue'
46
47
import HmrTsx from ' ./HmrTsx.vue'
48
+ import WithQuery from ' ./WithQuery.vue?with-query'
47
49
import Syntax from ' ./Syntax.vue'
48
50
import PreProcessors from ' ./PreProcessors.vue'
49
51
import PreProcessorsHmr from ' ./PreProcessorsHmr.vue'
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <h2 >Imported with query</h2 >
3
+ <p class =" imported-with-query" >{{ foo }}</p >
4
+ </template >
5
+
6
+ <script setup>
7
+ const foo = ' ok'
8
+ </script >
Original file line number Diff line number Diff line change @@ -22,6 +22,10 @@ test('should update', async () => {
22
22
expect ( await page . textContent ( '.hmr-inc' ) ) . toMatch ( 'count is 1' )
23
23
} )
24
24
25
+ test ( 'import with query should work' , async ( ) => {
26
+ expect ( await page . textContent ( '.imported-with-query' ) ) . toMatch ( 'ok' )
27
+ } )
28
+
25
29
test ( 'template/script latest syntax support' , async ( ) => {
26
30
expect ( await page . textContent ( '.syntax' ) ) . toBe ( 'baz' )
27
31
} )
You can’t perform that action at this time.
0 commit comments