File tree 2 files changed +11
-3
lines changed
2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ import {
19
19
getSrcDescriptor ,
20
20
getTempSrcDescriptor ,
21
21
} from './utils/descriptorCache'
22
- import { getResolvedScript , typeDepToSFCMap } from './script'
22
+ import { clearScriptCache , getResolvedScript , typeDepToSFCMap } from './script'
23
23
import { transformMain } from './main'
24
24
import { handleHotUpdate , handleTypeDepChange } from './handleHotUpdate'
25
25
import { transformTemplateAsModule } from './template'
@@ -361,5 +361,8 @@ export default function vuePlugin(rawOptions: Options = {}): Plugin<Api> {
361
361
}
362
362
}
363
363
} ,
364
+ buildEnd ( ) {
365
+ clearScriptCache ( )
366
+ } ,
364
367
}
365
368
}
Original file line number Diff line number Diff line change @@ -4,8 +4,8 @@ import { cache as descriptorCache } from './utils/descriptorCache'
4
4
import type { ResolvedOptions } from '.'
5
5
6
6
// ssr and non ssr builds would output different script content
7
- const clientCache = new WeakMap < SFCDescriptor , SFCScriptBlock | null > ( )
8
- const ssrCache = new WeakMap < SFCDescriptor , SFCScriptBlock | null > ( )
7
+ let clientCache = new WeakMap < SFCDescriptor , SFCScriptBlock | null > ( )
8
+ let ssrCache = new WeakMap < SFCDescriptor , SFCScriptBlock | null > ( )
9
9
10
10
export const typeDepToSFCMap = new Map < string , Set < string > > ( )
11
11
@@ -32,6 +32,11 @@ export function setResolvedScript(
32
32
; ( ssr ? ssrCache : clientCache ) . set ( descriptor , script )
33
33
}
34
34
35
+ export function clearScriptCache ( ) : void {
36
+ clientCache = new WeakMap ( )
37
+ ssrCache = new WeakMap ( )
38
+ }
39
+
35
40
// Check if we can use compile template as inlined render function
36
41
// inside <script setup>. This can only be done for build because
37
42
// inlined template cannot be individually hot updated.
You can’t perform that action at this time.
0 commit comments