@unpackjs/core 1.7.5 → 1.7.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/compiled/css-loader/index.js +180 -178
  2. package/compiled/less-loader/index.js +11 -11
  3. package/compiled/line-diff/index.js +4 -4
  4. package/compiled/line-diff/license +1 -1
  5. package/compiled/line-diff/package.json +1 -1
  6. package/compiled/portfinder/index.js +37 -37
  7. package/compiled/postcss-loader/index.js +261 -256
  8. package/compiled/sass-loader/index.js +24 -20
  9. package/compiled/sass-loader/package.json +1 -1
  10. package/compiled/semver/index.js +188 -170
  11. package/compiled/semver/package.json +1 -1
  12. package/compiled/style-loader/index.js +13 -13
  13. package/compiled/webpack-bundle-analyzer/index.js +198 -198
  14. package/compiled/webpack-merge/index.js +29 -29
  15. package/dist/bundler-config/chunkSplit.cjs +169 -156
  16. package/dist/bundler-config/chunkSplit.js +125 -134
  17. package/dist/bundler-config/css.cjs +181 -158
  18. package/dist/bundler-config/css.js +139 -151
  19. package/dist/bundler-config/experimentCss.cjs +203 -159
  20. package/dist/bundler-config/experimentCss.js +162 -152
  21. package/dist/bundler-config/helper.cjs +82 -78
  22. package/dist/bundler-config/helper.js +36 -55
  23. package/dist/bundler-config/index.cjs +260 -209
  24. package/dist/bundler-config/index.d.ts.map +1 -1
  25. package/dist/bundler-config/index.js +209 -182
  26. package/dist/bundler-config/jsMinify.cjs +114 -95
  27. package/dist/bundler-config/jsMinify.js +70 -73
  28. package/dist/colors.cjs +83 -56
  29. package/dist/colors.js +38 -37
  30. package/dist/config.cjs +107 -93
  31. package/dist/config.d.ts.map +1 -1
  32. package/dist/config.js +64 -70
  33. package/dist/constants.cjs +65 -62
  34. package/dist/constants.d.ts +1 -0
  35. package/dist/constants.d.ts.map +1 -1
  36. package/dist/constants.js +22 -38
  37. package/dist/createUnpack.cjs +111 -104
  38. package/dist/createUnpack.js +67 -82
  39. package/dist/global.cjs +36 -0
  40. package/dist/global.d.ts +2 -0
  41. package/dist/global.d.ts.map +1 -0
  42. package/dist/global.js +4 -0
  43. package/dist/index.cjs +174 -51
  44. package/dist/index.d.ts +2 -0
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js +33 -15
  47. package/dist/lightningcss/loader.cjs +56 -53
  48. package/dist/lightningcss/loader.d.ts.map +1 -1
  49. package/dist/lightningcss/loader.js +25 -34
  50. package/dist/lightningcss/minimizer.cjs +90 -109
  51. package/dist/lightningcss/minimizer.d.ts.map +1 -1
  52. package/dist/lightningcss/minimizer.js +59 -87
  53. package/dist/logger.cjs +104 -98
  54. package/dist/logger.js +59 -76
  55. package/dist/openBrowser.cjs +104 -81
  56. package/dist/openBrowser.js +56 -52
  57. package/dist/plugin-progress/rspack.cjs +104 -79
  58. package/dist/plugin-progress/rspack.js +59 -57
  59. package/dist/plugin-progress/webpack.cjs +111 -89
  60. package/dist/plugin-progress/webpack.js +65 -67
  61. package/dist/plugin.cjs +38 -29
  62. package/dist/plugin.js +8 -17
  63. package/dist/prebundleDeps.cjs +327 -337
  64. package/dist/prebundleDeps.d.ts.map +1 -1
  65. package/dist/prebundleDeps.js +278 -324
  66. package/dist/progressBar.cjs +82 -65
  67. package/dist/progressBar.js +38 -43
  68. package/dist/reporter.cjs +149 -124
  69. package/dist/reporter.d.ts.map +1 -1
  70. package/dist/reporter.js +102 -102
  71. package/dist/run/build.cjs +68 -67
  72. package/dist/run/build.js +24 -45
  73. package/dist/run/dev.cjs +96 -83
  74. package/dist/run/dev.d.ts.map +1 -1
  75. package/dist/run/dev.js +50 -61
  76. package/dist/run/index.cjs +74 -21
  77. package/dist/run/index.js +2 -9
  78. package/dist/typed-css-modules/loader.cjs +179 -188
  79. package/dist/typed-css-modules/loader.js +118 -151
  80. package/dist/typed-css-modules/plugin.cjs +113 -88
  81. package/dist/typed-css-modules/plugin.js +68 -66
  82. package/dist/typed-css-modules/utils.cjs +43 -42
  83. package/dist/typed-css-modules/utils.js +13 -30
  84. package/dist/types/chunkSplit.cjs +19 -15
  85. package/dist/types/chunkSplit.d.ts +2 -10
  86. package/dist/types/chunkSplit.d.ts.map +1 -1
  87. package/dist/types/chunkSplit.js +2 -9
  88. package/dist/types/config.cjs +19 -15
  89. package/dist/types/config.js +2 -9
  90. package/dist/types/index.cjs +101 -27
  91. package/dist/types/index.js +2 -9
  92. package/dist/types/lightningcss.cjs +19 -15
  93. package/dist/types/lightningcss.js +2 -9
  94. package/dist/types/logger.cjs +43 -34
  95. package/dist/types/logger.js +13 -22
  96. package/dist/types/plugin.cjs +19 -15
  97. package/dist/types/plugin.js +2 -9
  98. package/dist/utils.cjs +280 -304
  99. package/dist/utils.js +195 -241
  100. package/dist/watchFiles.cjs +73 -0
  101. package/dist/watchFiles.d.ts +3 -0
  102. package/dist/watchFiles.d.ts.map +1 -0
  103. package/dist/watchFiles.js +27 -0
  104. package/package.json +18 -21
  105. package/compiled/commander/index.d.ts +0 -1047
  106. package/compiled/commander/index.js +0 -2428
  107. package/compiled/commander/license +0 -22
  108. package/compiled/commander/package.json +0 -1
  109. package/dist/bundleRequire.cjs +0 -200
  110. package/dist/bundleRequire.d.ts +0 -5
  111. package/dist/bundleRequire.d.ts.map +0 -1
  112. package/dist/bundleRequire.js +0 -173
  113. package/dist/lightningcss/cache.cjs +0 -36
  114. package/dist/lightningcss/cache.d.ts +0 -2
  115. package/dist/lightningcss/cache.d.ts.map +0 -1
  116. package/dist/lightningcss/cache.js +0 -22
@@ -1,10 +1,10 @@
1
1
  (() => {
2
2
  var __webpack_modules__ = {
3
- 248: (module, __unused_webpack_exports, __nccwpck_require__) => {
3
+ 485: (module, __unused_webpack_exports, __nccwpck_require__) => {
4
4
  "use strict";
5
- const clone = __nccwpck_require__(572);
6
- const typeOf = __nccwpck_require__(279);
7
- const isPlainObject = __nccwpck_require__(814);
5
+ const clone = __nccwpck_require__(36);
6
+ const typeOf = __nccwpck_require__(223);
7
+ const isPlainObject = __nccwpck_require__(990);
8
8
  function cloneDeep(val, instanceClone) {
9
9
  switch (typeOf(val)) {
10
10
  case "object":
@@ -38,7 +38,7 @@
38
38
  }
39
39
  module.exports = cloneDeep;
40
40
  },
41
- 376: (module) => {
41
+ 967: (module) => {
42
42
  module.exports = flatten;
43
43
  flatten.flatten = flatten;
44
44
  flatten.unflatten = unflatten;
@@ -171,14 +171,14 @@
171
171
  return result;
172
172
  }
173
173
  },
174
- 814: (module, __unused_webpack_exports, __nccwpck_require__) => {
174
+ 990: (module, __unused_webpack_exports, __nccwpck_require__) => {
175
175
  "use strict";
176
176
  /*!
177
177
  * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
178
178
  *
179
179
  * Copyright (c) 2014-2017, Jon Schlinkert.
180
180
  * Released under the MIT License.
181
- */ var isObject = __nccwpck_require__(949);
181
+ */ var isObject = __nccwpck_require__(676);
182
182
  function isObjectObject(o) {
183
183
  return (
184
184
  isObject(o) === true &&
@@ -198,7 +198,7 @@
198
198
  return true;
199
199
  };
200
200
  },
201
- 949: (module) => {
201
+ 676: (module) => {
202
202
  "use strict";
203
203
  /*!
204
204
  * isobject <https://github.com/jonschlinkert/isobject>
@@ -211,7 +211,7 @@
211
211
  );
212
212
  };
213
213
  },
214
- 279: (module) => {
214
+ 223: (module) => {
215
215
  var toString = Object.prototype.toString;
216
216
  module.exports = function kindOf(val) {
217
217
  if (val === void 0) return "undefined";
@@ -346,7 +346,7 @@
346
346
  return false;
347
347
  }
348
348
  },
349
- 572: (module, __unused_webpack_exports, __nccwpck_require__) => {
349
+ 36: (module, __unused_webpack_exports, __nccwpck_require__) => {
350
350
  "use strict";
351
351
  /*!
352
352
  * shallow-clone <https://github.com/jonschlinkert/shallow-clone>
@@ -354,7 +354,7 @@
354
354
  * Copyright (c) 2015-present, Jon Schlinkert.
355
355
  * Released under the MIT License.
356
356
  */ const valueOf = Symbol.prototype.valueOf;
357
- const typeOf = __nccwpck_require__(279);
357
+ const typeOf = __nccwpck_require__(223);
358
358
  function clone(val, deep) {
359
359
  switch (typeOf(val)) {
360
360
  case "array":
@@ -420,7 +420,7 @@
420
420
  }
421
421
  module.exports = clone;
422
422
  },
423
- 543: function (__unused_webpack_module, exports, __nccwpck_require__) {
423
+ 110: function (__unused_webpack_module, exports, __nccwpck_require__) {
424
424
  "use strict";
425
425
  var __read =
426
426
  (this && this.__read) ||
@@ -472,19 +472,19 @@
472
472
  exports.customizeObject =
473
473
  exports.customizeArray =
474
474
  void 0;
475
- var wildcard_1 = __importDefault(__nccwpck_require__(859));
476
- var merge_with_1 = __importDefault(__nccwpck_require__(397));
477
- var join_arrays_1 = __importDefault(__nccwpck_require__(680));
478
- var unique_1 = __importDefault(__nccwpck_require__(71));
475
+ var wildcard_1 = __importDefault(__nccwpck_require__(151));
476
+ var merge_with_1 = __importDefault(__nccwpck_require__(879));
477
+ var join_arrays_1 = __importDefault(__nccwpck_require__(91));
478
+ var unique_1 = __importDefault(__nccwpck_require__(995));
479
479
  exports.unique = unique_1.default;
480
- var types_1 = __nccwpck_require__(972);
480
+ var types_1 = __nccwpck_require__(11);
481
481
  Object.defineProperty(exports, "CustomizeRule", {
482
482
  enumerable: true,
483
483
  get: function () {
484
484
  return types_1.CustomizeRule;
485
485
  },
486
486
  });
487
- var utils_1 = __nccwpck_require__(605);
487
+ var utils_1 = __nccwpck_require__(679);
488
488
  function merge(firstConfiguration) {
489
489
  var configurations = [];
490
490
  for (var _i = 1; _i < arguments.length; _i++) {
@@ -757,7 +757,7 @@
757
757
  }
758
758
  exports.customizeObject = customizeObject;
759
759
  },
760
- 680: function (__unused_webpack_module, exports, __nccwpck_require__) {
760
+ 91: function (__unused_webpack_module, exports, __nccwpck_require__) {
761
761
  "use strict";
762
762
  var __read =
763
763
  (this && this.__read) ||
@@ -800,9 +800,9 @@
800
800
  return mod && mod.__esModule ? mod : { default: mod };
801
801
  };
802
802
  Object.defineProperty(exports, "__esModule", { value: true });
803
- var clone_deep_1 = __importDefault(__nccwpck_require__(248));
804
- var merge_with_1 = __importDefault(__nccwpck_require__(397));
805
- var utils_1 = __nccwpck_require__(605);
803
+ var clone_deep_1 = __importDefault(__nccwpck_require__(485));
804
+ var merge_with_1 = __importDefault(__nccwpck_require__(879));
805
+ var utils_1 = __nccwpck_require__(679);
806
806
  var isArray = Array.isArray;
807
807
  function joinArrays(_a) {
808
808
  var _b = _a === void 0 ? {} : _a,
@@ -859,7 +859,7 @@
859
859
  }
860
860
  exports["default"] = joinArrays;
861
861
  },
862
- 397: function (__unused_webpack_module, exports) {
862
+ 879: function (__unused_webpack_module, exports) {
863
863
  "use strict";
864
864
  var __read =
865
865
  (this && this.__read) ||
@@ -907,7 +907,7 @@
907
907
  }
908
908
  exports["default"] = mergeWith;
909
909
  },
910
- 972: (__unused_webpack_module, exports) => {
910
+ 11: (__unused_webpack_module, exports) => {
911
911
  "use strict";
912
912
  Object.defineProperty(exports, "__esModule", { value: true });
913
913
  exports.CustomizeRule = void 0;
@@ -920,7 +920,7 @@
920
920
  CustomizeRule["Replace"] = "replace";
921
921
  })(CustomizeRule || (exports.CustomizeRule = CustomizeRule = {}));
922
922
  },
923
- 71: function (__unused_webpack_module, exports) {
923
+ 995: function (__unused_webpack_module, exports) {
924
924
  "use strict";
925
925
  var __read =
926
926
  (this && this.__read) ||
@@ -990,7 +990,7 @@
990
990
  }
991
991
  exports["default"] = mergeUnique;
992
992
  },
993
- 605: function (__unused_webpack_module, exports, __nccwpck_require__) {
993
+ 679: function (__unused_webpack_module, exports, __nccwpck_require__) {
994
994
  "use strict";
995
995
  var __read =
996
996
  (this && this.__read) ||
@@ -1022,7 +1022,7 @@
1022
1022
  exports.isFunction =
1023
1023
  exports.isRegex =
1024
1024
  void 0;
1025
- var flat_1 = __nccwpck_require__(376);
1025
+ var flat_1 = __nccwpck_require__(967);
1026
1026
  function isRegex(o) {
1027
1027
  return o instanceof RegExp;
1028
1028
  }
@@ -1104,7 +1104,7 @@
1104
1104
  }
1105
1105
  exports.isSameCondition = isSameCondition;
1106
1106
  },
1107
- 859: (module) => {
1107
+ 151: (module) => {
1108
1108
  "use strict";
1109
1109
  var REGEXP_PARTS = /(\*|\?)/g;
1110
1110
  function WildcardMatcher(text, separator) {
@@ -1195,6 +1195,6 @@
1195
1195
  }
1196
1196
  if (typeof __nccwpck_require__ !== "undefined")
1197
1197
  __nccwpck_require__.ab = __dirname + "/";
1198
- var __webpack_exports__ = __nccwpck_require__(543);
1198
+ var __webpack_exports__ = __nccwpck_require__(110);
1199
1199
  module.exports = __webpack_exports__;
1200
1200
  })();
@@ -1,183 +1,196 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
- var chunkSplit_exports = {};
29
- __export(chunkSplit_exports, {
30
- applyChunkSplitConfig: () => applyChunkSplitConfig
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.n = function(module) {
5
+ var getter = module && module.__esModule ? function() {
6
+ return module['default'];
7
+ } : function() {
8
+ return module;
9
+ };
10
+ __webpack_require__.d(getter, {
11
+ a: getter
12
+ });
13
+ return getter;
14
+ };
15
+ })();
16
+ (()=>{
17
+ __webpack_require__.d = function(exports1, definition) {
18
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
19
+ enumerable: true,
20
+ get: definition[key]
21
+ });
22
+ };
23
+ })();
24
+ (()=>{
25
+ __webpack_require__.o = function(obj, prop) {
26
+ return Object.prototype.hasOwnProperty.call(obj, prop);
27
+ };
28
+ })();
29
+ (()=>{
30
+ __webpack_require__.r = function(exports1) {
31
+ if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
32
+ value: 'Module'
33
+ });
34
+ Object.defineProperty(exports1, '__esModule', {
35
+ value: true
36
+ });
37
+ };
38
+ })();
39
+ var __webpack_exports__ = {};
40
+ __webpack_require__.r(__webpack_exports__);
41
+ __webpack_require__.d(__webpack_exports__, {
42
+ applyChunkSplitConfig: ()=>applyChunkSplitConfig
31
43
  });
32
- module.exports = __toCommonJS(chunkSplit_exports);
33
- var import_node_assert = __toESM(require("node:assert"));
34
- var import_constants = require("../constants.cjs");
35
- var import_utils = require("../utils.cjs");
44
+ const external_node_assert_namespaceObject = require("node:assert");
45
+ var external_node_assert_default = /*#__PURE__*/ __webpack_require__.n(external_node_assert_namespaceObject);
46
+ const external_constants_cjs_namespaceObject = require("../constants.cjs");
47
+ const external_utils_cjs_namespaceObject = require("../utils.cjs");
36
48
  function getForceSplittingGroups(forceSplitting) {
37
- const cacheGroups = {};
38
- const pairs = Array.isArray(forceSplitting) ? forceSplitting.map((regexp, index) => [`force-split-${index}`, regexp]) : Object.entries(forceSplitting);
39
- for (const [key, regexp] of pairs) {
40
- cacheGroups[key] = {
41
- test: regexp,
42
- name: key,
43
- chunks: "all",
44
- priority: 0,
45
- // Ignore minimum size, minimum chunks and maximum requests and always create chunks.
46
- enforce: true
49
+ const cacheGroups = {};
50
+ const pairs = Array.isArray(forceSplitting) ? forceSplitting.map((regexp, index)=>[
51
+ `force-split-${index}`,
52
+ regexp
53
+ ]) : Object.entries(forceSplitting);
54
+ for (const [key, regexp] of pairs)cacheGroups[key] = {
55
+ test: regexp,
56
+ name: key,
57
+ chunks: 'all',
58
+ priority: 0,
59
+ enforce: true
47
60
  };
48
- }
49
- return cacheGroups;
61
+ return cacheGroups;
50
62
  }
51
63
  function splitByExperience(ctx) {
52
- const { defaultConfig, forceSplittingGroups } = ctx;
53
- const experienceCacheGroup = {};
54
- const packageRegExps = {
55
- axios: /node_modules[\\/]axios(-.+)?[\\/]/,
56
- polyfill: /node_modules[\\/](?:tslib|core-js|@swc[\\/]helpers)[\\/]/
57
- };
58
- for (const [name, test] of Object.entries(packageRegExps)) {
59
- const key = `lib-${name}`;
60
- experienceCacheGroup[key] = {
61
- test,
62
- priority: 0,
63
- name: key
64
+ const { defaultConfig, forceSplittingGroups } = ctx;
65
+ const experienceCacheGroup = {};
66
+ const packageRegExps = {
67
+ axios: /node_modules[\\/]axios(-.+)?[\\/]/,
68
+ polyfill: /node_modules[\\/](?:tslib|core-js|@swc[\\/]helpers)[\\/]/
64
69
  };
65
- }
66
- return {
67
- ...defaultConfig,
68
- cacheGroups: {
69
- ...defaultConfig.cacheGroups,
70
- ...experienceCacheGroup,
71
- ...forceSplittingGroups
70
+ for (const [name, test] of Object.entries(packageRegExps)){
71
+ const key = `lib-${name}`;
72
+ experienceCacheGroup[key] = {
73
+ test,
74
+ priority: 0,
75
+ name: key
76
+ };
72
77
  }
73
- };
78
+ return {
79
+ ...defaultConfig,
80
+ cacheGroups: {
81
+ ...defaultConfig.cacheGroups,
82
+ ...experienceCacheGroup,
83
+ ...forceSplittingGroups
84
+ }
85
+ };
74
86
  }
75
87
  function splitBySize(ctx) {
76
- const { forceSplittingGroups, defaultConfig, chunkSplit } = ctx;
77
- (0, import_node_assert.default)(chunkSplit.strategy === "split-by-size");
78
- return {
79
- ...defaultConfig,
80
- minSize: chunkSplit.minSize ?? 0,
81
- maxSize: chunkSplit.maxSize ?? Number.POSITIVE_INFINITY,
82
- cacheGroups: {
83
- ...defaultConfig.cacheGroups,
84
- ...forceSplittingGroups
85
- }
86
- };
88
+ const { forceSplittingGroups, defaultConfig, chunkSplit } = ctx;
89
+ external_node_assert_default()('split-by-size' === chunkSplit.strategy);
90
+ return {
91
+ ...defaultConfig,
92
+ minSize: chunkSplit.minSize ?? 0,
93
+ maxSize: chunkSplit.maxSize ?? Number.POSITIVE_INFINITY,
94
+ cacheGroups: {
95
+ ...defaultConfig.cacheGroups,
96
+ ...forceSplittingGroups
97
+ }
98
+ };
87
99
  }
88
100
  const MODULE_PATH_REGEX = /.*[\\/]node_modules[\\/](?!\.pnpm[\\/])(?:(@[^\\/]+)[\\/])?([^\\/]+)/;
89
101
  function getPackageNameFromModulePath(modulePath) {
90
- const handleModuleContext = modulePath?.match(MODULE_PATH_REGEX);
91
- if (!handleModuleContext) {
92
- return void 0;
93
- }
94
- const [, scope, name] = handleModuleContext;
95
- const packageName = ["npm", (scope ?? "").replace("@", ""), name].filter(Boolean).join(".");
96
- return packageName;
102
+ const handleModuleContext = null == modulePath ? void 0 : modulePath.match(MODULE_PATH_REGEX);
103
+ if (!handleModuleContext) return;
104
+ const [, scope, name] = handleModuleContext;
105
+ const packageName = [
106
+ 'npm',
107
+ (scope ?? '').replace('@', ''),
108
+ name
109
+ ].filter(Boolean).join('.');
110
+ return packageName;
97
111
  }
98
112
  function splitByModule(ctx) {
99
- const { forceSplittingGroups, defaultConfig } = ctx;
100
- return {
101
- ...defaultConfig,
102
- minSize: 0,
103
- maxInitialRequests: Number.POSITIVE_INFINITY,
104
- cacheGroups: {
105
- ...defaultConfig.cacheGroups,
106
- ...forceSplittingGroups,
107
- vendors: {
108
- priority: -9,
109
- test: import_constants.NODE_MODULES_REGEX,
110
- name(module2) {
111
- return module2 ? getPackageNameFromModulePath(module2.context) : void 0;
113
+ const { forceSplittingGroups, defaultConfig } = ctx;
114
+ return {
115
+ ...defaultConfig,
116
+ minSize: 0,
117
+ maxInitialRequests: Number.POSITIVE_INFINITY,
118
+ cacheGroups: {
119
+ ...defaultConfig.cacheGroups,
120
+ ...forceSplittingGroups,
121
+ vendors: {
122
+ priority: -9,
123
+ test: external_constants_cjs_namespaceObject.NODE_MODULES_REGEX,
124
+ name (module) {
125
+ return module ? getPackageNameFromModulePath(module.context) : void 0;
126
+ }
127
+ }
112
128
  }
113
- }
114
- }
115
- };
129
+ };
116
130
  }
117
131
  function splitCustom(ctx) {
118
- const { forceSplittingGroups, defaultConfig } = ctx;
119
- return {
120
- ...defaultConfig,
121
- cacheGroups: {
122
- ...defaultConfig.cacheGroups,
123
- ...forceSplittingGroups
124
- }
125
- };
132
+ const { forceSplittingGroups, defaultConfig } = ctx;
133
+ return {
134
+ ...defaultConfig,
135
+ cacheGroups: {
136
+ ...defaultConfig.cacheGroups,
137
+ ...forceSplittingGroups
138
+ }
139
+ };
126
140
  }
127
141
  function allInOne(_ctx) {
128
- return false;
142
+ return false;
129
143
  }
130
144
  function singleVendor(ctx) {
131
- const { defaultConfig, forceSplittingGroups } = ctx;
132
- const singleVendorCacheGroup = {
133
- singleVendor: {
134
- test: import_constants.NODE_MODULES_REGEX,
135
- priority: 0,
136
- chunks: "all",
137
- name: "vendor",
138
- enforce: true
139
- }
140
- };
141
- return {
142
- ...defaultConfig,
143
- cacheGroups: {
144
- ...defaultConfig.cacheGroups,
145
- ...singleVendorCacheGroup,
146
- ...forceSplittingGroups
147
- }
148
- };
145
+ const { defaultConfig, forceSplittingGroups } = ctx;
146
+ const singleVendorCacheGroup = {
147
+ singleVendor: {
148
+ test: external_constants_cjs_namespaceObject.NODE_MODULES_REGEX,
149
+ priority: 0,
150
+ chunks: 'all',
151
+ name: 'vendor',
152
+ enforce: true
153
+ }
154
+ };
155
+ return {
156
+ ...defaultConfig,
157
+ cacheGroups: {
158
+ ...defaultConfig.cacheGroups,
159
+ ...singleVendorCacheGroup,
160
+ ...forceSplittingGroups
161
+ }
162
+ };
149
163
  }
150
164
  const SPLIT_STRATEGY_DISPATCHER = {
151
- "split-by-experience": splitByExperience,
152
- "split-by-module": splitByModule,
153
- "split-by-size": splitBySize,
154
- custom: splitCustom,
155
- "all-in-one": allInOne,
156
- "single-vendor": singleVendor
165
+ 'split-by-experience': splitByExperience,
166
+ 'split-by-module': splitByModule,
167
+ 'split-by-size': splitBySize,
168
+ custom: splitCustom,
169
+ 'all-in-one': allInOne,
170
+ 'single-vendor': singleVendor
157
171
  };
158
- const applyChunkSplitConfig = ({
159
- config,
160
- unpackConfig
161
- }) => {
162
- const { chunkSplit } = unpackConfig.performance || {};
163
- if (chunkSplit?.strategy) {
164
- let forceSplittingGroups = {};
165
- if (chunkSplit?.forceSplitting) {
166
- forceSplittingGroups = getForceSplittingGroups(chunkSplit.forceSplitting);
172
+ const applyChunkSplitConfig = ({ config, unpackConfig })=>{
173
+ const { chunkSplit } = unpackConfig.performance || {};
174
+ if (null == chunkSplit ? void 0 : chunkSplit.strategy) {
175
+ let forceSplittingGroups = {};
176
+ if (null == chunkSplit ? void 0 : chunkSplit.forceSplitting) forceSplittingGroups = getForceSplittingGroups(chunkSplit.forceSplitting);
177
+ const defaultConfig = {
178
+ chunks: 'all'
179
+ };
180
+ const splitChunksOptions = SPLIT_STRATEGY_DISPATCHER[chunkSplit.strategy]({
181
+ defaultConfig,
182
+ forceSplittingGroups,
183
+ chunkSplit
184
+ });
185
+ (0, external_utils_cjs_namespaceObject.setValueByPath)(config, [
186
+ 'optimization',
187
+ 'splitChunks'
188
+ ], splitChunksOptions);
167
189
  }
168
- const defaultConfig = {
169
- chunks: "all"
170
- };
171
- const splitChunksOptions = SPLIT_STRATEGY_DISPATCHER[chunkSplit.strategy]({
172
- defaultConfig,
173
- forceSplittingGroups,
174
- chunkSplit
175
- });
176
- (0, import_utils.setValueByPath)(config, ["optimization", "splitChunks"], splitChunksOptions);
177
- }
178
- return config;
190
+ return config;
179
191
  };
180
- // Annotate the CommonJS export names for ESM import in node:
181
- 0 && (module.exports = {
182
- applyChunkSplitConfig
192
+ var __webpack_export_target__ = exports;
193
+ for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
194
+ if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
195
+ value: true
183
196
  });