File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,10 @@ class CssModuleFactory {
101
101
class MiniCssExtractPlugin {
102
102
constructor ( options = { } ) {
103
103
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
+
105
108
this . options = Object . assign (
106
109
{
107
110
filename : DEFAULT_FILENAME ,
@@ -377,8 +380,6 @@ class MiniCssExtractPlugin {
377
380
] )
378
381
: '' ,
379
382
this . options . insert
380
- ? Template . asString ( [ this . options . insert , 'insert(linkTag);' ] )
381
- : 'var head = document.getElementsByTagName("head")[0]; head.appendChild(linkTag)'
382
383
] ) ,
383
384
'}).then(function() {' ,
384
385
Template . indent ( [ 'installedCssChunks[chunkId] = 0;' ] ) ,
You can’t perform that action at this time.
0 commit comments