File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -368,14 +368,14 @@ ExtractTextPlugin.prototype.apply = function(compiler) {
368
368
var asset = compilation . assets [ name ] ;
369
369
370
370
if ( / \. j s $ / . test ( name ) && asset . _source ) {
371
- var newName = name . replace ( / \. j s / , '.no_css.js' ) ;
372
- var newAsset = new CachedSource ( asset . _source ) ;
373
371
var regex = / \/ \* _ _ S T A R T _ C S S _ _ \* \/ [ \s \S ] * ?\/ \* _ _ E N D _ C S S _ _ \* \/ / g
374
372
var source = asset . source ( ) ;
375
373
376
374
if ( ! source . match ( regex ) ) {
377
375
return ;
378
376
}
377
+ var newName = name . replace ( / \. j s / , '.no_css.js' ) ;
378
+ var newAsset = new CachedSource ( asset . _source ) ;
379
379
// remove js that adds css to DOM via style-loader, so that React Loadable
380
380
// can serve smaller files (without css) in initial request.
381
381
newAsset . _cachedSource = source . replace ( regex , '' ) ;
You can’t perform that action at this time.
0 commit comments