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 {
99} from 'vue/compiler-sfc'
1010import type * as _compiler from 'vue/compiler-sfc'
1111import { computed , shallowRef } from 'vue'
12- import { exactRegex } from '@rolldown/pluginutils'
12+ import {
13+ exactRegex ,
14+ makeIdFiltersToMatchWithQuery ,
15+ } from '@rolldown/pluginutils'
1316import { version } from '../package.json'
1417import { resolveCompiler } from './compiler'
1518import { parseVueRequest } from './utils/query'
@@ -358,7 +361,10 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin<Api> {
358361 optionsHookIsCalled = true
359362 ; ( plugin . transform as TransformObjectHook ) . filter = {
360363 id : {
361- include : [ ...ensureArray ( include . value ) , / [ ? & ] v u e \b / ] ,
364+ include : [
365+ ...makeIdFiltersToMatchWithQuery ( ensureArray ( include . value ) ) ,
366+ / [ ? & ] v u e \b / ,
367+ ] ,
362368 exclude : exclude . value ,
363369 } ,
364370 }
Original file line number Diff line number Diff line change 1111 <HmrCircularReference name =" test" />
1212 <TypeProps msg =" msg" bar =" bar" :id =" 123" />
1313 <TypePropsTsx msg =" msg" bar =" bar" />
14+ <WithQuery />
1415 <Syntax />
1516 <PreProcessors />
1617 <PreProcessorsHmr />
4445import { version , defineAsyncComponent } from ' vue'
4546import Hmr from ' ./Hmr.vue'
4647import HmrTsx from ' ./HmrTsx.vue'
48+ import WithQuery from ' ./WithQuery.vue?with-query'
4749import Syntax from ' ./Syntax.vue'
4850import PreProcessors from ' ./PreProcessors.vue'
4951import 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 () => {
2222 expect ( await page . textContent ( '.hmr-inc' ) ) . toMatch ( 'count is 1' )
2323} )
2424
25+ test ( 'import with query should work' , async ( ) => {
26+ expect ( await page . textContent ( '.imported-with-query' ) ) . toMatch ( 'ok' )
27+ } )
28+
2529test ( 'template/script latest syntax support' , async ( ) => {
2630 expect ( await page . textContent ( '.syntax' ) ) . toBe ( 'baz' )
2731} )
You can’t perform that action at this time.
0 commit comments