File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed
packages/complex-types/src Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -41,20 +41,16 @@ export const unpluginFactory: UnpluginFactory<Options | undefined> = (
4141 return ;
4242 }
4343
44- let cached : Promise < string > | undefined ;
4544 ctx . read = async ( ) => {
46- cached ??= ( async ( ) => {
47- const code = await readAndUpdateLanguage ( ) ;
48- const result = transform ( code , file , resolvedOptions ) ;
45+ const code = await readAndUpdateLanguage ( ) ;
46+ const result = transform ( code , file , resolvedOptions ) ;
4947
50- return result ?. code ?? code ;
51- } ) ( ) ;
52-
53- return cached ;
48+ return result ?. code ?? code ;
5449 } ;
5550
56- for ( const mod of ctx . modules ) {
57- ctx . server . moduleGraph . invalidateModule ( mod ) ;
51+ const sfcModule = ctx . modules . find ( ( mod ) => mod . file === file ) ;
52+ if ( sfcModule ) {
53+ return [ sfcModule ] ;
5854 }
5955
6056 return ctx . modules ;
You can’t perform that action at this time.
0 commit comments