File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 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) {
6969function pitch ( request ) {
7070 // @ts -ignore
7171 const options = this . getOptions ( /** @type {Schema } */ ( schema ) ) ;
72+ const emit = typeof options . emit !== "undefined" ? options . emit : true ;
7273 const callback = this . async ( ) ;
7374 const optionsFromPlugin = /** @type {TODO } */ ( this ) [
7475 MiniCssExtractPlugin . pluginSymbol
@@ -114,7 +115,6 @@ function pitch(request) {
114115 }
115116
116117 const identifierCountMap = new Map ( ) ;
117- const emit = typeof options . emit !== "undefined" ? options . emit : true ;
118118 let lastDep ;
119119
120120 for ( const dependency of dependencies ) {
@@ -243,9 +243,11 @@ function pitch(request) {
243243
244244 let resultSource = `// extracted by ${ MiniCssExtractPlugin . pluginName } ` ;
245245
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 ;
249251
250252 callback ( null , resultSource ) ;
251253 } ;
You can’t perform that action at this time.
0 commit comments