File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -138,13 +138,20 @@ function applyHmr(args) {
138138 } )
139139
140140 if ( canAccept ) {
141- hot . accept ( async ( ) => {
141+ hot . accept ( async ( { hasChangedDeps } ) => {
142142 const newCssId = r . current . cssId
143143 const cssChanged = newCssId !== cssId
144144 // ensure old style sheet has been removed by now
145145 if ( cssChanged ) removeStylesheet ( cssId )
146146 // guard: css only change
147- if ( r . current . cssOnly && ( ! cssChanged || replaceCss ( cssId , newCssId ) ) ) {
147+ if (
148+ // NOTE hasChangedDeps is provided only by rollup-plugin-hot, and we
149+ // can't safely assume a CSS only change without it... this means we
150+ // can't support CSS only injection with Nollup or Webpack currently
151+ hasChangedDeps === false && // WARNING check false, not falsy!
152+ r . current . cssOnly &&
153+ ( ! cssChanged || replaceCss ( cssId , newCssId ) )
154+ ) {
148155 return
149156 }
150157
You can’t perform that action at this time.
0 commit comments