File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
packages/smooth-core/src/server Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,15 @@ function enhanceApp(options = {}, App) {
12
12
return options . enhanceApp ? options . enhanceApp ( App ) : App
13
13
}
14
14
15
+ function clearCache ( ) {
16
+ const keys = Object . keys ( require . cache )
17
+ keys . forEach ( key => {
18
+ if ( key . match ( / n o d e \/ s t a t i c \/ / ) ) {
19
+ delete require . cache [ key ]
20
+ }
21
+ } )
22
+ }
23
+
15
24
export default function ssrMiddleware ( {
16
25
config,
17
26
schema,
@@ -29,6 +38,10 @@ export default function ssrMiddleware({
29
38
'web/static/loadable-stats.json' ,
30
39
)
31
40
41
+ if ( config . env !== 'production' ) {
42
+ clearCache ( )
43
+ }
44
+
32
45
const nodeExtractor = new ChunkExtractor ( {
33
46
statsFile : nodeStats ,
34
47
outputPath : path . join ( config . cachePath , 'node/static' ) ,
You can’t perform that action at this time.
0 commit comments