File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,10 @@ class CssModuleFactory {
101101class MiniCssExtractPlugin {
102102 constructor ( options = { } ) {
103103 validateOptions ( schema , options , 'Mini CSS Extract Plugin' ) ;
104- const insert = options . insert ? options . insert . toString ( ) : null ;
104+ this . options . insert
105+ ? Template . asString ( [ this . options . insert , 'insert(linkTag);' ] )
106+ : 'var head = document.getElementsByTagName("head")[0]; head.appendChild(linkTag)
107+
105108 this . options = Object . assign (
106109 {
107110 filename : DEFAULT_FILENAME ,
@@ -377,8 +380,6 @@ class MiniCssExtractPlugin {
377380 ] )
378381 : '' ,
379382 this . options . insert
380- ? Template . asString ( [ this . options . insert , 'insert(linkTag);' ] )
381- : 'var head = document.getElementsByTagName("head")[0]; head.appendChild(linkTag)'
382383 ] ) ,
383384 '}).then(function() {' ,
384385 Template . indent ( [ 'installedCssChunks[chunkId] = 0;' ] ) ,
You can’t perform that action at this time.
0 commit comments