Skip to content

Commit ea91feb

Browse files
refactor: using insert option directly
1 parent 1578938 commit ea91feb

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,6 @@ class MiniCssExtractPlugin {
321321
contentHashType: MODULE_TYPE,
322322
}
323323
);
324-
const { insert } = this.options;
325324
return Template.asString([
326325
source,
327326
'',
@@ -377,9 +376,9 @@ class MiniCssExtractPlugin {
377376
'}',
378377
])
379378
: '',
380-
insert
381-
? Template.asString([insert, 'insert(linkTag);'])
382-
: 'var head = document.getElementsByTagName("head")[0]; head.appendChild(linkTag)',
379+
this.options.insert
380+
? Template.asString([this.options.insert, 'insert(linkTag);'])
381+
: 'var head = document.getElementsByTagName("head")[0]; head.appendChild(linkTag)'
383382
]),
384383
'}).then(function() {',
385384
Template.indent(['installedCssChunks[chunkId] = 0;']),

0 commit comments

Comments
 (0)