This repository was archived by the owner on Apr 6, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
packages/vite/src/plugins
test/fixtures/basic/pages Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import { walk } from 'estree-walker'
5
5
import MagicString from 'magic-string'
6
6
import { hash } from 'ohash'
7
7
import type { CallExpression } from 'estree'
8
- import { parseURL } from 'ufo'
8
+ import { parseQuery , parseURL } from 'ufo'
9
9
10
10
export interface ComposableKeysOptions {
11
11
sourcemap : boolean
@@ -22,8 +22,8 @@ export const composableKeysPlugin = createUnplugin((options: ComposableKeysOptio
22
22
name : 'nuxt:composable-keys' ,
23
23
enforce : 'post' ,
24
24
transform ( code , id ) {
25
- const { pathname } = parseURL ( decodeURIComponent ( pathToFileURL ( id ) . href ) )
26
- if ( ! pathname . match ( / \. ( m ? [ j t ] s x ? | v u e ) / ) ) { return }
25
+ const { pathname, search } = parseURL ( decodeURIComponent ( pathToFileURL ( id ) . href ) )
26
+ if ( ! pathname . match ( / \. ( m ? [ j t ] s x ? | v u e ) / ) || parseQuery ( search ) . type === 'style' ) { return }
27
27
if ( ! KEYED_FUNCTIONS_RE . test ( code ) ) { return }
28
28
const { 0 : script = code , index : codeIndex = 0 } = code . match ( / (?< = < s c r i p t [ ^ > ] * > ) [ \S \s . ] * ?(? = < \/ s c r i p t > ) / ) || [ ]
29
29
const s = new MagicString ( code )
Original file line number Diff line number Diff line change @@ -43,3 +43,10 @@ const { data: useLazyFetchTest2 } = await useLocalLazyFetch()
43
43
{{ useLazyFetchTest1 === useLazyFetchTest2 }}
44
44
</div >
45
45
</template >
46
+
47
+ <style scoped>
48
+ body {
49
+ background-color : #000 ;
50
+ color : #fff ;
51
+ }
52
+ </style >
You can’t perform that action at this time.
0 commit comments