Skip to content

Commit b986c54

Browse files
committed
feat: ability to disable extract modules, ci fix
1 parent 6001569 commit b986c54

File tree

9 files changed

+147
-43
lines changed

9 files changed

+147
-43
lines changed

test/cases/disable-extract-func/expected/1.js

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,23 @@
33
/* 1 */,
44
/* 2 */,
55
/* 3 */,
6-
/* 4 */
6+
/* 4 */,
7+
/* 5 */
78
/***/ (function(module, __webpack_exports__, __webpack_require__) {
89

910
"use strict";
1011
__webpack_require__.r(__webpack_exports__);
11-
/* harmony import */ var _in_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5);
12+
/* harmony import */ var _in_async__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6);
1213
/* harmony import */ var _in_async__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_in_async__WEBPACK_IMPORTED_MODULE_0__);
13-
/* harmony import */ var _in_async2_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6);
14+
/* harmony import */ var _in_async2_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7);
1415
/* harmony import */ var _in_async2_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_in_async2_css__WEBPACK_IMPORTED_MODULE_1__);
15-
/* harmony import */ var _in_async_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7);
16+
/* harmony import */ var _in_async_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8);
1617
/* harmony import */ var _in_async_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_in_async_css__WEBPACK_IMPORTED_MODULE_2__);
1718
/* harmony import */ var _both_async_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2);
1819
/* harmony import */ var _both_async_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_both_async_css__WEBPACK_IMPORTED_MODULE_3__);
19-
/* harmony import */ var _both_page_async_disabled_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(8);
20+
/* harmony import */ var _both_page_async_disabled_css__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9);
2021
/* harmony import */ var _both_page_async_disabled_css__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_both_page_async_disabled_css__WEBPACK_IMPORTED_MODULE_4__);
21-
/* harmony import */ var _both_page_async_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9);
22+
/* harmony import */ var _both_page_async_css__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(10);
2223
/* harmony import */ var _both_page_async_css__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_both_page_async_css__WEBPACK_IMPORTED_MODULE_5__);
2324

2425

@@ -32,40 +33,40 @@ __webpack_require__.r(__webpack_exports__);
3233

3334

3435
/***/ }),
35-
/* 5 */
36+
/* 6 */
3637
/***/ (function(module, exports) {
3738

3839
// console.log('in-async.js');
3940

4041

4142
/***/ }),
42-
/* 6 */
43+
/* 7 */
4344
/***/ (function(module, exports, __webpack_require__) {
4445

4546
// extracted by mini-css-extract-plugin
4647

4748
/***/ }),
48-
/* 7 */
49+
/* 8 */
4950
/***/ (function(module, exports, __webpack_require__) {
5051

51-
exports = module.exports = __webpack_require__(12)(false);
52+
exports = module.exports = __webpack_require__(14)(false);
5253
// Imports
53-
exports.i(__webpack_require__(13), "");
54+
exports.i(__webpack_require__(15), "");
5455
// Module
5556
exports.push([module.i, ".in-async {\n background: green;\n}\n", ""]);
5657

5758

5859
/***/ }),
59-
/* 8 */
60+
/* 9 */
6061
/***/ (function(module, exports, __webpack_require__) {
6162

62-
exports = module.exports = __webpack_require__(12)(false);
63+
exports = module.exports = __webpack_require__(14)(false);
6364
// Module
6465
exports.push([module.i, ".both-page-async-disabled {\n color: yellow;\n}\n", ""]);
6566

6667

6768
/***/ }),
68-
/* 9 */
69+
/* 10 */
6970
/***/ (function(module, exports, __webpack_require__) {
7071

7172
// extracted by mini-css-extract-plugin
Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,29 @@
1-
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[2],{
1+
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[2],[
2+
/* 0 */,
3+
/* 1 */,
4+
/* 2 */,
5+
/* 3 */,
6+
/* 4 */,
7+
/* 5 */,
8+
/* 6 */,
9+
/* 7 */,
10+
/* 8 */
11+
/***/ (function(module, exports, __webpack_require__) {
12+
13+
exports = module.exports = __webpack_require__(14)(false);
14+
// Module
15+
exports.push([module.i, ".both-page-async-disabled {\n color: yellow;\n}\n", ""]);
16+
17+
18+
/***/ }),
19+
/* 9 */
20+
/***/ (function(module, exports, __webpack_require__) {
21+
22+
// extracted by mini-css-extract-plugin
223

3-
/***/ 11:
24+
/***/ }),
25+
/* 10 */,
26+
/* 11 */
427
/***/ (function(module, __webpack_exports__, __webpack_require__) {
528

629
"use strict";
@@ -9,29 +32,35 @@ __webpack_require__.r(__webpack_exports__);
932
/* harmony import */ var _both_page_async_disabled_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_both_page_async_disabled_css__WEBPACK_IMPORTED_MODULE_0__);
1033
/* harmony import */ var _both_page_async_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9);
1134
/* harmony import */ var _both_page_async_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_both_page_async_css__WEBPACK_IMPORTED_MODULE_1__);
35+
/* harmony import */ var _is_async1_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12);
36+
/* harmony import */ var _is_async1_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_is_async1_css__WEBPACK_IMPORTED_MODULE_2__);
37+
/* harmony import */ var _is_async2_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(13);
38+
/* harmony import */ var _is_async2_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_is_async2_css__WEBPACK_IMPORTED_MODULE_3__);
39+
40+
1241

1342

1443

1544
// console.log('async2.js');
1645

1746

1847
/***/ }),
19-
20-
/***/ 8:
48+
/* 12 */
2149
/***/ (function(module, exports, __webpack_require__) {
2250

23-
exports = module.exports = __webpack_require__(12)(false);
51+
exports = module.exports = __webpack_require__(14)(false);
2452
// Module
25-
exports.push([module.i, ".both-page-async-disabled {\n color: yellow;\n}\n", ""]);
53+
exports.push([module.i, ".is-async-1 {\r\n background: magenta;\r\n}", ""]);
2654

2755

2856
/***/ }),
29-
30-
/***/ 9:
57+
/* 13 */
3158
/***/ (function(module, exports, __webpack_require__) {
3259

33-
// extracted by mini-css-extract-plugin
60+
exports = module.exports = __webpack_require__(14)(false);
61+
// Module
62+
exports.push([module.i, ".is-async-2 {\r\n background: brown;\r\n}", ""]);
3463

35-
/***/ })
3664

37-
}]);
65+
/***/ })
66+
]]);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.async {
2-
background: blue;
1+
.both-page-async {
2+
color: cyan;
33
}
44

Lines changed: 49 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,55 @@
1-
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[3],{
1+
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[3],[
2+
/* 0 */,
3+
/* 1 */,
4+
/* 2 */,
5+
/* 3 */,
6+
/* 4 */,
7+
/* 5 */,
8+
/* 6 */,
9+
/* 7 */,
10+
/* 8 */,
11+
/* 9 */
12+
/***/ (function(module, exports, __webpack_require__) {
13+
14+
exports = module.exports = __webpack_require__(14)(false);
15+
// Module
16+
exports.push([module.i, ".both-page-async-disabled {\n color: yellow;\n}\n", ""]);
217

3-
/***/ 10:
18+
19+
/***/ }),
20+
/* 10 */
421
/***/ (function(module, exports, __webpack_require__) {
522

623
// extracted by mini-css-extract-plugin
724

8-
/***/ })
25+
/***/ }),
26+
/* 11 */,
27+
/* 12 */
28+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
29+
30+
"use strict";
31+
__webpack_require__.r(__webpack_exports__);
32+
/* harmony import */ var _both_page_async_disabled_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9);
33+
/* harmony import */ var _both_page_async_disabled_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_both_page_async_disabled_css__WEBPACK_IMPORTED_MODULE_0__);
34+
/* harmony import */ var _both_page_async_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(10);
35+
/* harmony import */ var _both_page_async_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_both_page_async_css__WEBPACK_IMPORTED_MODULE_1__);
36+
/* harmony import */ var _is_async1_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13);
37+
/* harmony import */ var _is_async1_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_is_async1_css__WEBPACK_IMPORTED_MODULE_2__);
38+
39+
40+
941

10-
}]);
42+
// console.log('async2.js');
43+
44+
45+
/***/ }),
46+
/* 13 */
47+
/***/ (function(module, exports, __webpack_require__) {
48+
49+
exports = module.exports = __webpack_require__(14)(false);
50+
// Module
51+
exports.push([module.i, ".is-async-1 {\r\n background: magenta;\r\n}", ""]);
52+
53+
54+
/***/ })
55+
]]);
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.async {
2+
background: blue;
3+
}
4+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
(window["webpackJsonp"] = window["webpackJsonp"] || []).push([[4],{
2+
3+
/***/ 11:
4+
/***/ (function(module, exports, __webpack_require__) {
5+
6+
// extracted by mini-css-extract-plugin
7+
8+
/***/ })
9+
10+
}]);

test/cases/disable-extract-func/expected/index1.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
/******/
8383
/******/
8484
/******/ // mini-css-extract-plugin CSS loading
85-
/******/ var cssChunks = {"1":1,"3":1};
85+
/******/ var cssChunks = {"1":1,"4":1};
8686
/******/ if(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);
8787
/******/ else if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {
8888
/******/ promises.push(installedCssChunks[chunkId] = new Promise(function(resolve, reject) {
@@ -258,9 +258,9 @@ __webpack_require__.r(__webpack_exports__);
258258

259259

260260

261-
__webpack_require__.e(/* import() */ 1).then(__webpack_require__.bind(null, 4));
261+
__webpack_require__.e(/* import() */ 1).then(__webpack_require__.bind(null, 5));
262262

263-
__webpack_require__.e(/* import() */ 3).then(__webpack_require__.t.bind(null, 10, 7));
263+
__webpack_require__.e(/* import() */ 4).then(__webpack_require__.t.bind(null, 11, 7));
264264

265265
// console.log('index.js');
266266

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.is-async-2 {
2+
background: brown;
3+
}

test/cases/disable-extract-func/expected/index2.js

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@
3434
/******/
3535
/******/ // object to store loaded CSS chunks
3636
/******/ var installedCssChunks = {
37-
/******/ 4: 0
37+
/******/ 2: 0
3838
/******/ }
3939
/******/
4040
/******/ // object to store loaded and loading chunks
4141
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
4242
/******/ // Promise = chunk loading, 0 = chunk loaded
4343
/******/ var installedChunks = {
44-
/******/ 4: 0
44+
/******/ 2: 0
4545
/******/ };
4646
/******/
4747
/******/
@@ -82,7 +82,7 @@
8282
/******/
8383
/******/
8484
/******/ // mini-css-extract-plugin CSS loading
85-
/******/ var cssChunks = {"2":1};
85+
/******/ var cssChunks = {"3":1};
8686
/******/ if(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);
8787
/******/ else if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {
8888
/******/ promises.push(installedCssChunks[chunkId] = new Promise(function(resolve, reject) {
@@ -245,16 +245,28 @@
245245
/******/ return __webpack_require__(__webpack_require__.s = 3);
246246
/******/ })
247247
/************************************************************************/
248-
/******/ ({
248+
/******/ ([
249+
/* 0 */,
250+
/* 1 */,
251+
/* 2 */,
252+
/* 3 */
253+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
249254

250-
/***/ 3:
251-
/***/ (function(module, exports, __webpack_require__) {
255+
"use strict";
256+
__webpack_require__.r(__webpack_exports__);
257+
/* harmony import */ var _is_async2_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4);
258+
/* harmony import */ var _is_async2_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_is_async2_css__WEBPACK_IMPORTED_MODULE_0__);
259+
__webpack_require__.e(/* import() */ 3).then(__webpack_require__.bind(null, 12));
252260

253-
__webpack_require__.e(/* import() */ 2).then(__webpack_require__.bind(null, 11));
254261

255262
// console.log('index2');
256263

257264

258-
/***/ })
265+
/***/ }),
266+
/* 4 */
267+
/***/ (function(module, exports, __webpack_require__) {
259268

260-
/******/ });
269+
// extracted by mini-css-extract-plugin
270+
271+
/***/ })
272+
/******/ ]);

0 commit comments

Comments
 (0)