Skip to content

Commit 06e84c7

Browse files
test: fix
1 parent 4e4a95d commit 06e84c7

20 files changed

Lines changed: 4364 additions & 1232 deletions

File tree

package-lock.json

Lines changed: 4294 additions & 1176 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ class MiniCssExtractPlugin {
795795
compilation.runtimeTemplate.requestShortener,
796796
);
797797

798-
if (modules.size > 0) {
798+
if (modules && modules.size > 0) {
799799
const { hashFunction, hashDigest, hashDigestLength } = outputOptions;
800800
const { createHash } = compiler.webpack.util;
801801
const hash = createHash(/** @type {string} */ (hashFunction));
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
"use strict";
22
(self["webpackChunk"] = self["webpackChunk"] || []).push([[0],{
33

4-
/***/ 2:
5-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4+
/***/ 2
5+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
66

77
__webpack_require__.r(__webpack_exports__);
88
// extracted by mini-css-extract-plugin
99

1010

11-
/***/ })
11+
/***/ }
1212

1313
}]);

test/cases/devtool-source-map-from-loaders/expected/main.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/cases/devtool-source-map/expected/main.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/cases/hmr-locals/expected/main.js

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/******/ (() => { // webpackBootstrap
22
/******/ var __webpack_modules__ = ({
33

4-
/***/ "../../../src/hmr/hotModuleReplacement.js":
4+
/***/ "../../../src/hmr/hotModuleReplacement.js"
55
/*!************************************************!*\
66
!*** ../../../src/hmr/hotModuleReplacement.js ***!
77
\************************************************/
8-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
8+
(module, __unused_webpack_exports, __webpack_require__) {
99

1010
/* global document */
1111
/*
@@ -310,13 +310,13 @@ module.exports = function (moduleId, options) {
310310
};
311311

312312

313-
/***/ }),
313+
/***/ },
314314

315-
/***/ "../../../src/hmr/normalize-url.js":
315+
/***/ "../../../src/hmr/normalize-url.js"
316316
/*!*****************************************!*\
317317
!*** ../../../src/hmr/normalize-url.js ***!
318318
\*****************************************/
319-
/***/ ((module) => {
319+
(module) {
320320

321321
/**
322322
* @param {string[]} pathComponents path components
@@ -367,13 +367,13 @@ module.exports = function normalizeUrl(urlString) {
367367
};
368368

369369

370-
/***/ }),
370+
/***/ },
371371

372-
/***/ "./index.css":
372+
/***/ "./index.css"
373373
/*!*******************!*\
374374
!*** ./index.css ***!
375375
\*******************/
376-
/***/ ((module, __webpack_exports__, __webpack_require__) => {
376+
(module, __webpack_exports__, __webpack_require__) {
377377

378378
"use strict";
379379
__webpack_require__.r(__webpack_exports__);
@@ -405,7 +405,7 @@ __webpack_require__.r(__webpack_exports__);
405405
}
406406

407407

408-
/***/ })
408+
/***/ }
409409

410410
/******/ });
411411
/************************************************************************/
@@ -420,6 +420,12 @@ __webpack_require__.r(__webpack_exports__);
420420
/******/ if (cachedModule.error !== undefined) throw cachedModule.error;
421421
/******/ return cachedModule.exports;
422422
/******/ }
423+
/******/ // Check if module exists (development only)
424+
/******/ if (__webpack_modules__[moduleId] === undefined) {
425+
/******/ var e = new Error("Cannot find module '" + moduleId + "'");
426+
/******/ e.code = 'MODULE_NOT_FOUND';
427+
/******/ throw e;
428+
/******/ }
423429
/******/ // Create a new module (and put it into the cache)
424430
/******/ var module = __webpack_module_cache__[moduleId] = {
425431
/******/ id: moduleId,
@@ -836,7 +842,8 @@ __webpack_require__.r(__webpack_exports__);
836842
/******/ update.m,
837843
/******/ promises,
838844
/******/ currentUpdateApplyHandlers,
839-
/******/ updatedModules
845+
/******/ updatedModules,
846+
/******/ update.css
840847
/******/ );
841848
/******/ return promises;
842849
/******/ }, [])

test/cases/hmr/expected/main.js

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/******/ (() => { // webpackBootstrap
22
/******/ var __webpack_modules__ = ({
33

4-
/***/ "../../../src/hmr/hotModuleReplacement.js":
4+
/***/ "../../../src/hmr/hotModuleReplacement.js"
55
/*!************************************************!*\
66
!*** ../../../src/hmr/hotModuleReplacement.js ***!
77
\************************************************/
8-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
8+
(module, __unused_webpack_exports, __webpack_require__) {
99

1010
/* global document */
1111
/*
@@ -310,13 +310,13 @@ module.exports = function (moduleId, options) {
310310
};
311311

312312

313-
/***/ }),
313+
/***/ },
314314

315-
/***/ "../../../src/hmr/normalize-url.js":
315+
/***/ "../../../src/hmr/normalize-url.js"
316316
/*!*****************************************!*\
317317
!*** ../../../src/hmr/normalize-url.js ***!
318318
\*****************************************/
319-
/***/ ((module) => {
319+
(module) {
320320

321321
/**
322322
* @param {string[]} pathComponents path components
@@ -367,13 +367,13 @@ module.exports = function normalizeUrl(urlString) {
367367
};
368368

369369

370-
/***/ }),
370+
/***/ },
371371

372-
/***/ "./index.css":
372+
/***/ "./index.css"
373373
/*!*******************!*\
374374
!*** ./index.css ***!
375375
\*******************/
376-
/***/ ((module, __webpack_exports__, __webpack_require__) => {
376+
(module, __webpack_exports__, __webpack_require__) {
377377

378378
"use strict";
379379
__webpack_require__.r(__webpack_exports__);
@@ -402,7 +402,7 @@ __webpack_require__.r(__webpack_exports__);
402402
}
403403

404404

405-
/***/ })
405+
/***/ }
406406

407407
/******/ });
408408
/************************************************************************/
@@ -417,6 +417,12 @@ __webpack_require__.r(__webpack_exports__);
417417
/******/ if (cachedModule.error !== undefined) throw cachedModule.error;
418418
/******/ return cachedModule.exports;
419419
/******/ }
420+
/******/ // Check if module exists (development only)
421+
/******/ if (__webpack_modules__[moduleId] === undefined) {
422+
/******/ var e = new Error("Cannot find module '" + moduleId + "'");
423+
/******/ e.code = 'MODULE_NOT_FOUND';
424+
/******/ throw e;
425+
/******/ }
420426
/******/ // Create a new module (and put it into the cache)
421427
/******/ var module = __webpack_module_cache__[moduleId] = {
422428
/******/ id: moduleId,
@@ -821,7 +827,8 @@ __webpack_require__.r(__webpack_exports__);
821827
/******/ update.m,
822828
/******/ promises,
823829
/******/ currentUpdateApplyHandlers,
824-
/******/ updatedModules
830+
/******/ updatedModules,
831+
/******/ update.css
825832
/******/ );
826833
/******/ return promises;
827834
/******/ }, [])
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
"use strict";
22
(self["webpackChunk"] = self["webpackChunk"] || []).push([[0],{
33

4-
/***/ 2:
5-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4+
/***/ 2
5+
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
66

77
__webpack_require__.r(__webpack_exports__);
88
// extracted by mini-css-extract-plugin
99

1010

11-
/***/ })
11+
/***/ }
1212

1313
}]);

test/cases/pathinfo-devtool-source-map/expected/main.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
(self["webpackChunk"] = self["webpackChunk"] || []).push([[1],{
22

3-
/***/ 2:
4-
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
3+
/***/ 2
4+
(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) {
55

66
__webpack_require__.e(/* import() | b1 */ 2).then(__webpack_require__.bind(__webpack_require__, 4));
77
__webpack_require__.e(/* import() | b2 */ 3).then(__webpack_require__.bind(__webpack_require__, 5));
88
__webpack_require__.e(/* import() | b3 */ 4).then(__webpack_require__.t.bind(__webpack_require__, 6, 23));
99

1010

11-
/***/ })
11+
/***/ }
1212

1313
}]);

0 commit comments

Comments
 (0)