File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ function hotLoader(content, context) {
69
69
function pitch ( request ) {
70
70
// @ts -ignore
71
71
const options = this . getOptions ( /** @type {Schema } */ ( schema ) ) ;
72
+ const emit = typeof options . emit !== "undefined" ? options . emit : true ;
72
73
const callback = this . async ( ) ;
73
74
const optionsFromPlugin = /** @type {TODO } */ ( this ) [
74
75
MiniCssExtractPlugin . pluginSymbol
@@ -114,7 +115,6 @@ function pitch(request) {
114
115
}
115
116
116
117
const identifierCountMap = new Map ( ) ;
117
- const emit = typeof options . emit !== "undefined" ? options . emit : true ;
118
118
let lastDep ;
119
119
120
120
for ( const dependency of dependencies ) {
@@ -243,9 +243,11 @@ function pitch(request) {
243
243
244
244
let resultSource = `// extracted by ${ MiniCssExtractPlugin . pluginName } ` ;
245
245
246
- resultSource += this . hot
247
- ? hotLoader ( result , { loaderContext : this , options, locals } )
248
- : result ;
246
+ // only attempt hotreloading if the css is actually used for something other than hash values
247
+ resultSource +=
248
+ this . hot && emit
249
+ ? hotLoader ( result , { loaderContext : this , options, locals } )
250
+ : result ;
249
251
250
252
callback ( null , resultSource ) ;
251
253
} ;
You can’t perform that action at this time.
0 commit comments