File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
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+ const insert = 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 ,
@@ -376,9 +379,7 @@ class MiniCssExtractPlugin {
376379 '}' ,
377380 ] )
378381 : '' ,
379- this . options . insert
380- ? Template . asString ( [ this . options . insert , 'insert(linkTag);' ] )
381- : 'var head = document.getElementsByTagName("head")[0]; head.appendChild(linkTag)'
382+ this . options . insert ,
382383 ] ) ,
383384 '}).then(function() {' ,
384385 Template . indent ( [ 'installedCssChunks[chunkId] = 0;' ] ) ,
You can’t perform that action at this time.
0 commit comments