File tree 2 files changed +13
-1
lines changed
packages/vite/src/node/plugins
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import {
18
18
CLIENT_PUBLIC_PATH ,
19
19
DEP_VERSION_RE ,
20
20
FS_PREFIX ,
21
+ SPECIAL_QUERY_RE ,
21
22
} from '../constants'
22
23
import {
23
24
debugHmr ,
@@ -743,7 +744,8 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
743
744
// update the module graph for HMR analysis.
744
745
// node CSS imports does its own graph update in the css-analysis plugin so we
745
746
// only handle js graph updates here.
746
- if ( ! isCSSRequest ( importer ) ) {
747
+ // note that we want to handle .css?raw and .css?url here
748
+ if ( ! isCSSRequest ( importer ) || SPECIAL_QUERY_RE . test ( importer ) ) {
747
749
// attached by pluginContainer.addWatchFile
748
750
const pluginImports = ( this as any ) . _addedImports as
749
751
| Set < string >
Original file line number Diff line number Diff line change @@ -448,6 +448,16 @@ test('?raw', async () => {
448
448
expect ( await rawImportCss . textContent ( ) ) . toBe (
449
449
readFileSync ( require . resolve ( '../raw-imported.css' ) , 'utf-8' ) ,
450
450
)
451
+
452
+ if ( ! isBuild ) {
453
+ editFile ( 'raw-imported.css' , ( code ) =>
454
+ code . replace ( 'color: yellow' , 'color: blue' ) ,
455
+ )
456
+ await untilUpdated (
457
+ ( ) => page . textContent ( '.raw-imported-css' ) ,
458
+ 'color: blue' ,
459
+ )
460
+ }
451
461
} )
452
462
453
463
test ( 'import css in less' , async ( ) => {
You can’t perform that action at this time.
0 commit comments