Skip to content

Commit ae85878

Browse files
fix: don't use initialize hooks to allow dynamic plugin injection
1 parent 41f4a7b commit ae85878

File tree

33 files changed

+6758
-3695
lines changed

33 files changed

+6758
-3695
lines changed

.github/workflows/main.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
cache: "npm"
3737

3838
- name: Install dependencies
39-
run: npm ci
39+
run: npm ci --legacy-peer-deps
4040

4141
- name: Lint
4242
run: npm run lint
@@ -54,7 +54,7 @@ jobs:
5454
runs-on: ${{ matrix.os }}
5555

5656
concurrency:
57-
group: test-${{ matrix.os }}-v${{ matrix.node-version }}-${{ matrix.webpack-version }}-${{ github.ref }}
57+
group: ${{ github.workflow }}-${{ matrix.os }}-v${{ matrix.node }}-${{ matrix.webpack }}-${{ github.ref }}
5858
cancel-in-progress: true
5959

6060
strategy:
@@ -77,11 +77,11 @@ jobs:
7777
cache: "npm"
7878

7979
- name: Install dependencies
80-
run: npm ci
80+
run: npm ci --legacy-peer-deps
8181

8282
- name: Install webpack ${{ matrix.webpack-version }}
8383
if: matrix.webpack-version != 'latest'
84-
run: npm i webpack@${{ matrix.webpack-version }}
84+
run: npm i webpack@${{ matrix.webpack-version }} --legacy-peer-deps
8585

8686
- name: Run tests for webpack version ${{ matrix.webpack-version }}
8787
run: npm run test:coverage -- --ci

examples/chunk-optimization/dist/webpack-5/488.js renamed to examples/chunk-optimization/dist/webpack-5/192.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
"use strict";
2-
(self["webpackChunk"] = self["webpackChunk"] || []).push([[488],{
2+
(self["webpackChunk"] = self["webpackChunk"] || []).push([[192],{
33

4-
/***/ 432:
4+
/***/ 810:
55
/***/ ((module, __webpack_exports__, __webpack_require__) => {
66

77
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
8-
/* harmony export */ c: () => (__WEBPACK_DEFAULT_EXPORT__)
8+
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
99
/* harmony export */ });
10-
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(849);
10+
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(935);
1111
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
1212
// Imports
1313

@@ -20,16 +20,16 @@ ___CSS_LOADER_EXPORT___.push([module.id, "body {\n background: snow;\n}\n", ""]
2020

2121
/***/ }),
2222

23-
/***/ 488:
23+
/***/ 192:
2424
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
2525

2626
__webpack_require__.r(__webpack_exports__);
2727
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
2828
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
2929
/* harmony export */ });
30-
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(108);
30+
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(591);
3131
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
32-
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_main_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(432);
32+
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_main_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(810);
3333

3434

3535

@@ -38,11 +38,11 @@ var options = {};
3838
options.insert = "head";
3939
options.singleton = false;
4040

41-
var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_main_css__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .c, options);
41+
var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_main_css__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A, options);
4242

4343

4444

45-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_main_css__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .c.locals || {});
45+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_main_css__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.locals || {});
4646

4747
/***/ })
4848

examples/chunk-optimization/dist/webpack-5/980.js renamed to examples/chunk-optimization/dist/webpack-5/461.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use strict";
2-
(self["webpackChunk"] = self["webpackChunk"] || []).push([[980],{
2+
(self["webpackChunk"] = self["webpackChunk"] || []).push([[461],{
33

4-
/***/ 849:
4+
/***/ 935:
55
/***/ ((module) => {
66

77

@@ -73,7 +73,7 @@ module.exports = function (cssWithMappingToString) {
7373

7474
/***/ }),
7575

76-
/***/ 108:
76+
/***/ 591:
7777
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
7878

7979

Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!doctype html><html><head><meta charset="utf-8"><title>Webpack App</title><meta name="viewport" content="width=device-width,initial-scale=1"><script defer="defer" src="libMath.js"></script><script defer="defer" src="libText.js"></script><script defer="defer" src="980.js"></script><script defer="defer" src="488.js"></script><script defer="defer" src="entryA.js"></script></head><body></body></html>
1+
<!doctype html><html><head><meta charset="utf-8"><title>Webpack App</title><meta name="viewport" content="width=device-width,initial-scale=1"><script defer="defer" src="libMath.js"></script><script defer="defer" src="libText.js"></script><script defer="defer" src="461.js"></script><script defer="defer" src="192.js"></script><script defer="defer" src="entryA.js"></script></head><body></body></html>

examples/chunk-optimization/dist/webpack-5/entryA.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/******/ (() => { // webpackBootstrap
22
/******/ var __webpack_modules__ = ({
33

4-
/***/ 67:
4+
/***/ 910:
55
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
66

7-
__webpack_require__(488);
8-
var multiply = __webpack_require__(540);
9-
var concat = __webpack_require__(280);
7+
__webpack_require__(192);
8+
var multiply = __webpack_require__(199);
9+
var concat = __webpack_require__(631);
1010
var h1 = document.createElement("h1");
1111
h1.innerHTML = concat("Hello world from Entry ", multiply(1, 1));
1212
document.body.appendChild(h1);
@@ -124,7 +124,7 @@ document.body.appendChild(h1);
124124
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
125125
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
126126
/******/ var installedChunks = {
127-
/******/ 568: 0
127+
/******/ 570: 0
128128
/******/ };
129129
/******/
130130
/******/ // no chunk on demand loading
@@ -179,7 +179,7 @@ document.body.appendChild(h1);
179179
/******/ // startup
180180
/******/ // Load entry module and return exports
181181
/******/ // This entry module depends on other loaded chunks and execution need to be delayed
182-
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, [288,8,980,488], () => (__webpack_require__(67)))
182+
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, [646,209,461,192], () => (__webpack_require__(910)))
183183
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
184184
/******/
185185
/******/ })()
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!doctype html><html><head><meta charset="utf-8"><title>Webpack App</title><meta name="viewport" content="width=device-width,initial-scale=1"><script defer="defer" src="libMath.js"></script><script defer="defer" src="980.js"></script><script defer="defer" src="488.js"></script><script defer="defer" src="entryB.js"></script></head><body></body></html>
1+
<!doctype html><html><head><meta charset="utf-8"><title>Webpack App</title><meta name="viewport" content="width=device-width,initial-scale=1"><script defer="defer" src="libMath.js"></script><script defer="defer" src="461.js"></script><script defer="defer" src="192.js"></script><script defer="defer" src="entryB.js"></script></head><body></body></html>

examples/chunk-optimization/dist/webpack-5/entryB.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/******/ (() => { // webpackBootstrap
22
/******/ var __webpack_modules__ = ({
33

4-
/***/ 304:
4+
/***/ 123:
55
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
66

7-
__webpack_require__(488);
8-
var multiply = __webpack_require__(540);
7+
__webpack_require__(192);
8+
var multiply = __webpack_require__(199);
99
var h1 = document.createElement("h1");
1010
h1.innerHTML = "Hello world from Entry " + multiply(1, 2);
1111
document.body.appendChild(h1);
@@ -123,7 +123,7 @@ document.body.appendChild(h1);
123123
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
124124
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
125125
/******/ var installedChunks = {
126-
/******/ 758: 0
126+
/******/ 761: 0
127127
/******/ };
128128
/******/
129129
/******/ // no chunk on demand loading
@@ -178,7 +178,7 @@ document.body.appendChild(h1);
178178
/******/ // startup
179179
/******/ // Load entry module and return exports
180180
/******/ // This entry module depends on other loaded chunks and execution need to be delayed
181-
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, [288,980,488], () => (__webpack_require__(304)))
181+
/******/ var __webpack_exports__ = __webpack_require__.O(undefined, [646,461,192], () => (__webpack_require__(123)))
182182
/******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__);
183183
/******/
184184
/******/ })()
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!doctype html><html><head><meta charset="utf-8"><title>Webpack App</title><meta name="viewport" content="width=device-width,initial-scale=1"><script defer="defer" src="libMath.js"></script><script defer="defer" src="libText.js"></script><script defer="defer" src="980.js"></script><script defer="defer" src="488.js"></script><script defer="defer" src="entryA.js"></script><script defer="defer" src="entryB.js"></script></head><body></body></html>
1+
<!doctype html><html><head><meta charset="utf-8"><title>Webpack App</title><meta name="viewport" content="width=device-width,initial-scale=1"><script defer="defer" src="libMath.js"></script><script defer="defer" src="libText.js"></script><script defer="defer" src="461.js"></script><script defer="defer" src="192.js"></script><script defer="defer" src="entryA.js"></script><script defer="defer" src="entryB.js"></script></head><body></body></html>

examples/chunk-optimization/dist/webpack-5/libMath.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
(self["webpackChunk"] = self["webpackChunk"] || []).push([[288],{
1+
(self["webpackChunk"] = self["webpackChunk"] || []).push([[646],{
22

3-
/***/ 540:
3+
/***/ 199:
44
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
55

6-
var sum = __webpack_require__(636);
6+
var sum = __webpack_require__(16);
77
module.exports = function multiply(a, b) {
88
var m = 0;
99
for (var i = 0; i < a; i = sum(i, 1)) {
@@ -15,7 +15,7 @@ module.exports = function multiply(a, b) {
1515

1616
/***/ }),
1717

18-
/***/ 636:
18+
/***/ 16:
1919
/***/ ((module) => {
2020

2121
module.exports = function sum(a, b) {

examples/chunk-optimization/dist/webpack-5/libText.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
(self["webpackChunk"] = self["webpackChunk"] || []).push([[8],{
1+
(self["webpackChunk"] = self["webpackChunk"] || []).push([[209],{
22

3-
/***/ 280:
3+
/***/ 631:
44
/***/ ((module) => {
55

66
module.exports = function concat(a, b) {

examples/custom-insertion-position/dist/webpack-5/bundle.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/******/ (() => { // webpackBootstrap
2-
var __webpack_exports__ = {};
32
var h1 = document.createElement("h1");
43
h1.innerHTML = "Hello world!";
54
document.body.appendChild(h1);

examples/custom-template/dist/webpack-5/bundle.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/******/ (() => { // webpackBootstrap
22
/******/ var __webpack_modules__ = ({
33

4-
/***/ 268:
4+
/***/ 969:
55
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
66

77
"use strict";
@@ -51,14 +51,10 @@ __webpack_require__.r(__webpack_exports__);
5151
/******/
5252
/************************************************************************/
5353
var __webpack_exports__ = {};
54-
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
55-
(() => {
56-
__webpack_require__(268);
54+
__webpack_require__(969);
5755
var h1 = document.createElement("h1");
5856
h1.innerHTML = "Hello world!";
5957
document.body.appendChild(h1);
6058

61-
})();
62-
6359
/******/ })()
6460
;

examples/default/dist/webpack-5/bundle.js

+11-15
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/******/ (() => { // webpackBootstrap
22
/******/ var __webpack_modules__ = ({
33

4-
/***/ 432:
4+
/***/ 810:
55
/***/ ((module, __webpack_exports__, __webpack_require__) => {
66

77
"use strict";
88
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
9-
/* harmony export */ c: () => (__WEBPACK_DEFAULT_EXPORT__)
9+
/* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
1010
/* harmony export */ });
11-
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(849);
11+
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(935);
1212
/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
1313
// Imports
1414

@@ -21,7 +21,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, "body {\n background: snow;\n}\n", ""]
2121

2222
/***/ }),
2323

24-
/***/ 849:
24+
/***/ 935:
2525
/***/ ((module) => {
2626

2727
"use strict";
@@ -94,17 +94,17 @@ module.exports = function (cssWithMappingToString) {
9494

9595
/***/ }),
9696

97-
/***/ 488:
97+
/***/ 192:
9898
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
9999

100100
"use strict";
101101
__webpack_require__.r(__webpack_exports__);
102102
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
103103
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
104104
/* harmony export */ });
105-
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(108);
105+
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(591);
106106
/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
107-
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_main_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(432);
107+
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_main_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(810);
108108

109109

110110

@@ -113,15 +113,15 @@ var options = {};
113113
options.insert = "head";
114114
options.singleton = false;
115115

116-
var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_main_css__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .c, options);
116+
var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_main_css__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A, options);
117117

118118

119119

120-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_main_css__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .c.locals || {});
120+
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_main_css__WEBPACK_IMPORTED_MODULE_1__/* ["default"] */ .A.locals || {});
121121

122122
/***/ }),
123123

124-
/***/ 108:
124+
/***/ 591:
125125
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
126126

127127
"use strict";
@@ -471,14 +471,10 @@ module.exports = function (list, options) {
471471
/******/
472472
/************************************************************************/
473473
var __webpack_exports__ = {};
474-
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
475-
(() => {
476-
__webpack_require__(488);
474+
__webpack_require__(192);
477475
var h1 = document.createElement("h1");
478476
h1.innerHTML = "Hello world!";
479477
document.body.appendChild(h1);
480478

481-
})();
482-
483479
/******/ })()
484480
;

examples/favicon/dist/webpack-5/bundle.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/******/ (() => { // webpackBootstrap
22
/******/ var __webpack_modules__ = ({
33

4-
/***/ 268:
4+
/***/ 969:
55
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
66

77
"use strict";
@@ -51,14 +51,10 @@ __webpack_require__.r(__webpack_exports__);
5151
/******/
5252
/************************************************************************/
5353
var __webpack_exports__ = {};
54-
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
55-
(() => {
56-
__webpack_require__(268);
54+
__webpack_require__(969);
5755
var h1 = document.createElement("h1");
5856
h1.innerHTML = "Hello world!";
5957
document.body.appendChild(h1);
6058

61-
})();
62-
6359
/******/ })()
6460
;

examples/html-loader/dist/webpack-5/bundle.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/******/ (() => { // webpackBootstrap
22
/******/ var __webpack_modules__ = ({
33

4-
/***/ 268:
4+
/***/ 969:
55
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
66

77
"use strict";
@@ -51,14 +51,10 @@ __webpack_require__.r(__webpack_exports__);
5151
/******/
5252
/************************************************************************/
5353
var __webpack_exports__ = {};
54-
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
55-
(() => {
56-
__webpack_require__(268);
54+
__webpack_require__(969);
5755
var h1 = document.createElement("h1");
5856
h1.innerHTML = "Hello world!";
5957
document.body.appendChild(h1);
6058

61-
})();
62-
6359
/******/ })()
6460
;

0 commit comments

Comments
 (0)