@@ -309,7 +309,7 @@ class MiniCssExtractPlugin {
309
309
this . _sortedModulesCache = new WeakMap ( ) ;
310
310
311
311
this . options = Object . assign (
312
- { filename : DEFAULT_FILENAME , ignoreOrder : false } ,
312
+ { filename : DEFAULT_FILENAME , ignoreOrder : false , emitFile : true } ,
313
313
options
314
314
) ;
315
315
@@ -426,6 +426,7 @@ class MiniCssExtractPlugin {
426
426
new CssDependencyTemplate ( )
427
427
) ;
428
428
429
+ const { emitFile } = this . options ;
429
430
if ( isWebpack4 ) {
430
431
compilation . mainTemplate . hooks . renderManifest . tap (
431
432
pluginName ,
@@ -439,7 +440,7 @@ class MiniCssExtractPlugin {
439
440
const filenameTemplate =
440
441
chunk . filenameTemplate || this . options . filename ;
441
442
442
- if ( renderedModules . length > 0 ) {
443
+ if ( renderedModules . length > 0 && emitFile ) {
443
444
result . push ( {
444
445
render : ( ) =>
445
446
this . renderContentAsset (
@@ -473,7 +474,7 @@ class MiniCssExtractPlugin {
473
474
const filenameTemplate =
474
475
chunk . filenameTemplate || this . options . chunkFilename ;
475
476
476
- if ( renderedModules . length > 0 ) {
477
+ if ( renderedModules . length > 0 && emitFile ) {
477
478
result . push ( {
478
479
render : ( ) =>
479
480
this . renderContentAsset (
@@ -515,7 +516,7 @@ class MiniCssExtractPlugin {
515
516
? this . options . filename
516
517
: this . options . chunkFilename ;
517
518
518
- if ( renderedModules . length > 0 ) {
519
+ if ( renderedModules . length > 0 && emitFile ) {
519
520
result . push ( {
520
521
render : ( ) =>
521
522
this . renderContentAsset (
0 commit comments