Skip to content

Commit

Permalink
fix: ES5 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeyParton authored Apr 7, 2021
1 parent e8918ab commit 43e081f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1017,7 +1017,7 @@ class MiniCssExtractPlugin {
[
`var href = ${RuntimeGlobals.require}.miniCssF(chunkId);`,
`var fullhref = ${RuntimeGlobals.publicPath} + href;`,
'const oldTag = findStylesheet(href, fullhref);',
'var oldTag = findStylesheet(href, fullhref);',
'if(!oldTag) return;',
`promises.push(new Promise(${runtimeTemplate.basicFunction(
'resolve, reject',
Expand Down
2 changes: 1 addition & 1 deletion test/cases/hmr/expected/webpack-5/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ module.exports = function (urlString) {
/******/ chunkIds.forEach((chunkId) => {
/******/ var href = __webpack_require__.miniCssF(chunkId);
/******/ var fullhref = __webpack_require__.p + href;
/******/ const oldTag = findStylesheet(href, fullhref);
/******/ var oldTag = findStylesheet(href, fullhref);
/******/ if(!oldTag) return;
/******/ promises.push(new Promise((resolve, reject) => {
/******/ var tag = createStylesheet(chunkId, fullhref, () => {
Expand Down

0 comments on commit 43e081f

Please sign in to comment.