Skip to content

Commit 43e081f

Browse files
authored
fix: ES5 compatibility
1 parent e8918ab commit 43e081f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,7 @@ class MiniCssExtractPlugin {
10171017
[
10181018
`var href = ${RuntimeGlobals.require}.miniCssF(chunkId);`,
10191019
`var fullhref = ${RuntimeGlobals.publicPath} + href;`,
1020-
'const oldTag = findStylesheet(href, fullhref);',
1020+
'var oldTag = findStylesheet(href, fullhref);',
10211021
'if(!oldTag) return;',
10221022
`promises.push(new Promise(${runtimeTemplate.basicFunction(
10231023
'resolve, reject',

test/cases/hmr/expected/webpack-5/main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ module.exports = function (urlString) {
914914
/******/ chunkIds.forEach((chunkId) => {
915915
/******/ var href = __webpack_require__.miniCssF(chunkId);
916916
/******/ var fullhref = __webpack_require__.p + href;
917-
/******/ const oldTag = findStylesheet(href, fullhref);
917+
/******/ var oldTag = findStylesheet(href, fullhref);
918918
/******/ if(!oldTag) return;
919919
/******/ promises.push(new Promise((resolve, reject) => {
920920
/******/ var tag = createStylesheet(chunkId, fullhref, () => {

0 commit comments

Comments
 (0)