@rspack/core 1.3.8 → 1.3.9

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.
@@ -1,7 +1,7 @@
1
1
  /******/ (() => { // webpackBootstrap
2
2
  /******/ var __webpack_modules__ = ({
3
3
 
4
- /***/ 40:
4
+ /***/ 523:
5
5
  /***/ ((module) => {
6
6
 
7
7
  function BrowserslistError(message) {
@@ -20,18 +20,18 @@ module.exports = BrowserslistError
20
20
 
21
21
  /***/ }),
22
22
 
23
- /***/ 82:
23
+ /***/ 113:
24
24
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
25
25
 
26
26
  var jsReleases = __nccwpck_require__(613)
27
27
  var agents = (__nccwpck_require__(946).agents)
28
- var e2c = __nccwpck_require__(554)
28
+ var e2c = __nccwpck_require__(867)
29
29
  var jsEOL = __nccwpck_require__(995)
30
30
  var path = __nccwpck_require__(928)
31
31
 
32
- var BrowserslistError = __nccwpck_require__(40)
33
- var env = __nccwpck_require__(944)
34
- var parseWithoutCache = __nccwpck_require__(481) // Will load browser.js in webpack
32
+ var BrowserslistError = __nccwpck_require__(523)
33
+ var env = __nccwpck_require__(217)
34
+ var parseWithoutCache = __nccwpck_require__(494) // Will load browser.js in webpack
35
35
 
36
36
  var YEAR = 365.259641 * 24 * 60 * 60 * 1000
37
37
  var ANDROID_EVERGREEN_FIRST = '37'
@@ -1262,7 +1262,7 @@ module.exports = browserslist
1262
1262
 
1263
1263
  /***/ }),
1264
1264
 
1265
- /***/ 944:
1265
+ /***/ 217:
1266
1266
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
1267
1267
 
1268
1268
  var feature = (__nccwpck_require__(930)["default"])
@@ -1270,7 +1270,7 @@ var region = (__nccwpck_require__(800)["default"])
1270
1270
  var fs = __nccwpck_require__(896)
1271
1271
  var path = __nccwpck_require__(928)
1272
1272
 
1273
- var BrowserslistError = __nccwpck_require__(40)
1273
+ var BrowserslistError = __nccwpck_require__(523)
1274
1274
 
1275
1275
  var IS_SECTION = /^\s*\[(.+)]\s*$/
1276
1276
  var CONFIG_PATTERN = /^browserslist-config-/
@@ -1318,23 +1318,23 @@ function eachParent(file, callback, cache) {
1318
1318
  if (!pathInRoot(loc)) {
1319
1319
  break
1320
1320
  }
1321
- if (cache && (loc in cache)) {
1321
+ if (cache && loc in cache) {
1322
1322
  result = cache[loc]
1323
1323
  break
1324
1324
  }
1325
1325
  pathsForCacheResult.push(loc)
1326
-
1326
+
1327
1327
  if (!isDirectory(loc)) {
1328
1328
  continue
1329
1329
  }
1330
-
1330
+
1331
1331
  var locResult = callback(loc)
1332
1332
  if (typeof locResult !== 'undefined') {
1333
1333
  result = locResult
1334
1334
  break
1335
1335
  }
1336
1336
  } while (loc !== (loc = path.dirname(loc)))
1337
-
1337
+
1338
1338
  if (cache && !process.env.BROWSERSLIST_DISABLE_CACHE) {
1339
1339
  pathsForCacheResult.forEach(function (cachePath) {
1340
1340
  cache[cachePath] = result
@@ -1419,10 +1419,10 @@ function parsePackageOrReadConfig(file) {
1419
1419
  if (file in parseConfigCache) {
1420
1420
  return parseConfigCache[file]
1421
1421
  }
1422
-
1422
+
1423
1423
  var isPackage = path.basename(file) === 'package.json'
1424
1424
  var result = isPackage ? parsePackage(file) : module.exports.readConfig(file)
1425
-
1425
+
1426
1426
  if (!process.env.BROWSERSLIST_DISABLE_CACHE) {
1427
1427
  parseConfigCache[file] = result
1428
1428
  }
@@ -1496,6 +1496,9 @@ module.exports = {
1496
1496
  checkExtend(name)
1497
1497
  }
1498
1498
  var queries = eval("require")(require.resolve(name, { paths: ['.', ctx.path] }))
1499
+ if (typeof queries === 'object' && queries !== null && queries.__esModule) {
1500
+ queries = queries.default
1501
+ }
1499
1502
  if (queries) {
1500
1503
  if (Array.isArray(queries)) {
1501
1504
  return queries
@@ -1530,10 +1533,14 @@ module.exports = {
1530
1533
  } else if (process.env.BROWSERSLIST_STATS) {
1531
1534
  stats = process.env.BROWSERSLIST_STATS
1532
1535
  } else if (opts.path && path.resolve && fs.existsSync) {
1533
- stats = eachParent(opts.path, function (dir) {
1534
- var file = path.join(dir, 'browserslist-stats.json')
1535
- return isFile(file) ? file : undefined
1536
- }, statCache)
1536
+ stats = eachParent(
1537
+ opts.path,
1538
+ function (dir) {
1539
+ var file = path.join(dir, 'browserslist-stats.json')
1540
+ return isFile(file) ? file : undefined
1541
+ },
1542
+ statCache
1543
+ )
1537
1544
  }
1538
1545
  if (typeof stats === 'string') {
1539
1546
  try {
@@ -1641,43 +1648,48 @@ module.exports = {
1641
1648
  },
1642
1649
 
1643
1650
  findConfigFile: function findConfigFile(from) {
1644
- return eachParent(from, function (dir) {
1645
- var config = path.join(dir, 'browserslist')
1646
- var pkg = path.join(dir, 'package.json')
1647
- var rc = path.join(dir, '.browserslistrc')
1648
-
1649
- var pkgBrowserslist
1650
- if (isFile(pkg)) {
1651
- try {
1652
- pkgBrowserslist = parsePackage(pkg)
1653
- } catch (e) {
1654
- if (e.name === 'BrowserslistError') throw e
1655
- console.warn(
1656
- '[Browserslist] Could not parse ' + pkg + '. Ignoring it.'
1657
- )
1651
+ return eachParent(
1652
+ from,
1653
+ function (dir) {
1654
+ var config = path.join(dir, 'browserslist')
1655
+ var pkg = path.join(dir, 'package.json')
1656
+ var rc = path.join(dir, '.browserslistrc')
1657
+
1658
+ var pkgBrowserslist
1659
+ if (isFile(pkg)) {
1660
+ try {
1661
+ pkgBrowserslist = parsePackage(pkg)
1662
+ } catch (e) {
1663
+ if (e.name === 'BrowserslistError') throw e
1664
+ console.warn(
1665
+ '[Browserslist] Could not parse ' + pkg + '. Ignoring it.'
1666
+ )
1667
+ }
1658
1668
  }
1659
- }
1660
1669
 
1661
- if (isFile(config) && pkgBrowserslist) {
1662
- throw new BrowserslistError(
1663
- dir + ' contains both browserslist and package.json with browsers'
1664
- )
1665
- } else if (isFile(rc) && pkgBrowserslist) {
1666
- throw new BrowserslistError(
1667
- dir + ' contains both .browserslistrc and package.json with browsers'
1668
- )
1669
- } else if (isFile(config) && isFile(rc)) {
1670
- throw new BrowserslistError(
1671
- dir + ' contains both .browserslistrc and browserslist'
1672
- )
1673
- } else if (isFile(config)) {
1674
- return config
1675
- } else if (isFile(rc)) {
1676
- return rc
1677
- } else if (pkgBrowserslist) {
1678
- return pkg
1679
- }
1680
- }, configPathCache)
1670
+ if (isFile(config) && pkgBrowserslist) {
1671
+ throw new BrowserslistError(
1672
+ dir + ' contains both browserslist and package.json with browsers'
1673
+ )
1674
+ } else if (isFile(rc) && pkgBrowserslist) {
1675
+ throw new BrowserslistError(
1676
+ dir +
1677
+ ' contains both .browserslistrc and package.json with browsers'
1678
+ )
1679
+ } else if (isFile(config) && isFile(rc)) {
1680
+ throw new BrowserslistError(
1681
+ dir + ' contains both .browserslistrc and browserslist'
1682
+ )
1683
+ } else if (isFile(config)) {
1684
+ return config
1685
+ } else if (isFile(rc)) {
1686
+ return rc
1687
+ } else if (pkgBrowserslist) {
1688
+ return pkg
1689
+ }
1690
+ },
1691
+ configPathCache
1692
+ )
1681
1693
  },
1682
1694
 
1683
1695
  findConfig: function findConfig(from) {
@@ -1726,7 +1738,7 @@ module.exports = {
1726
1738
 
1727
1739
  /***/ }),
1728
1740
 
1729
- /***/ 481:
1741
+ /***/ 494:
1730
1742
  /***/ ((module) => {
1731
1743
 
1732
1744
  var AND_REGEXP = /^\s+and\s+(.*)/i
@@ -1811,7 +1823,7 @@ module.exports = function parse(all, queries) {
1811
1823
 
1812
1824
  /***/ }),
1813
1825
 
1814
- /***/ 554:
1826
+ /***/ 867:
1815
1827
  /***/ ((module) => {
1816
1828
 
1817
1829
  module.exports = {
@@ -1993,7 +2005,15 @@ module.exports = {
1993
2005
  "34.0": "132",
1994
2006
  "34.1": "132",
1995
2007
  "34.2": "132",
1996
- "35.0": "134"
2008
+ "34.3": "132",
2009
+ "34.4": "132",
2010
+ "34.5": "132",
2011
+ "35.0": "134",
2012
+ "35.1": "134",
2013
+ "35.2": "134",
2014
+ "36.0": "136",
2015
+ "36.1": "136",
2016
+ "37.0": "138"
1997
2017
  };
1998
2018
 
1999
2019
  /***/ }),
@@ -2096,7 +2116,7 @@ module.exports = /*#__PURE__*/JSON.parse('{"v0.8":{"start":"2012-06-25","end":"2
2096
2116
  /******/ // startup
2097
2117
  /******/ // Load entry module and return exports
2098
2118
  /******/ // This entry module is referenced by other modules so it can't be inlined
2099
- /******/ var __webpack_exports__ = __nccwpck_require__(82);
2119
+ /******/ var __webpack_exports__ = __nccwpck_require__(113);
2100
2120
  /******/ module.exports = __webpack_exports__;
2101
2121
  /******/
2102
2122
  /******/ })()
@@ -1 +1 @@
1
- {"name":"browserslist","author":"Andrey Sitnik <andrey@sitnik.ru>","version":"4.24.4","funding":[{"type":"opencollective","url":"https://opencollective.com/browserslist"},{"type":"tidelift","url":"https://tidelift.com/funding/github/npm/browserslist"},{"type":"github","url":"https://github.com/sponsors/ai"}],"license":"MIT","types":"index.d.ts","type":"commonjs"}
1
+ {"name":"browserslist","author":"Andrey Sitnik <andrey@sitnik.ru>","version":"4.24.5","funding":[{"type":"opencollective","url":"https://opencollective.com/browserslist"},{"type":"tidelift","url":"https://tidelift.com/funding/github/npm/browserslist"},{"type":"github","url":"https://github.com/sponsors/ai"}],"license":"MIT","types":"index.d.ts","type":"commonjs"}
@@ -2,13 +2,13 @@
2
2
  /******/ "use strict";
3
3
  /******/ var __webpack_modules__ = ({
4
4
 
5
- /***/ 705:
5
+ /***/ 36:
6
6
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
7
7
 
8
8
 
9
9
  Object.defineProperty(exports, "__esModule", ({ value: true }));
10
10
  exports.ZodError = exports.quotelessJson = exports.ZodIssueCode = void 0;
11
- const util_1 = __nccwpck_require__(46);
11
+ const util_1 = __nccwpck_require__(919);
12
12
  exports.ZodIssueCode = util_1.util.arrayToEnum([
13
13
  "invalid_type",
14
14
  "invalid_literal",
@@ -146,7 +146,7 @@ ZodError.create = (issues) => {
146
146
 
147
147
  /***/ }),
148
148
 
149
- /***/ 503:
149
+ /***/ 874:
150
150
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
151
151
 
152
152
 
@@ -155,7 +155,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
155
155
  };
156
156
  Object.defineProperty(exports, "__esModule", ({ value: true }));
157
157
  exports.getErrorMap = exports.setErrorMap = exports.defaultErrorMap = void 0;
158
- const en_1 = __importDefault(__nccwpck_require__(183));
158
+ const en_1 = __importDefault(__nccwpck_require__(986));
159
159
  exports.defaultErrorMap = en_1.default;
160
160
  let overrideErrorMap = en_1.default;
161
161
  function setErrorMap(map) {
@@ -170,7 +170,7 @@ exports.getErrorMap = getErrorMap;
170
170
 
171
171
  /***/ }),
172
172
 
173
- /***/ 831:
173
+ /***/ 286:
174
174
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
175
175
 
176
176
 
@@ -189,17 +189,17 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
189
189
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
190
190
  };
191
191
  Object.defineProperty(exports, "__esModule", ({ value: true }));
192
- __exportStar(__nccwpck_require__(503), exports);
193
- __exportStar(__nccwpck_require__(707), exports);
194
- __exportStar(__nccwpck_require__(160), exports);
195
- __exportStar(__nccwpck_require__(46), exports);
196
- __exportStar(__nccwpck_require__(735), exports);
197
- __exportStar(__nccwpck_require__(705), exports);
192
+ __exportStar(__nccwpck_require__(874), exports);
193
+ __exportStar(__nccwpck_require__(148), exports);
194
+ __exportStar(__nccwpck_require__(163), exports);
195
+ __exportStar(__nccwpck_require__(919), exports);
196
+ __exportStar(__nccwpck_require__(796), exports);
197
+ __exportStar(__nccwpck_require__(36), exports);
198
198
 
199
199
 
200
200
  /***/ }),
201
201
 
202
- /***/ 266:
202
+ /***/ 121:
203
203
  /***/ ((__unused_webpack_module, exports) => {
204
204
 
205
205
 
@@ -214,7 +214,7 @@ var errorUtil;
214
214
 
215
215
  /***/ }),
216
216
 
217
- /***/ 707:
217
+ /***/ 148:
218
218
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
219
219
 
220
220
 
@@ -223,8 +223,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
223
223
  };
224
224
  Object.defineProperty(exports, "__esModule", ({ value: true }));
225
225
  exports.isAsync = exports.isValid = exports.isDirty = exports.isAborted = exports.OK = exports.DIRTY = exports.INVALID = exports.ParseStatus = exports.addIssueToContext = exports.EMPTY_PATH = exports.makeIssue = void 0;
226
- const errors_1 = __nccwpck_require__(503);
227
- const en_1 = __importDefault(__nccwpck_require__(183));
226
+ const errors_1 = __nccwpck_require__(874);
227
+ const en_1 = __importDefault(__nccwpck_require__(986));
228
228
  const makeIssue = (params) => {
229
229
  const { data, path, errorMaps, issueData } = params;
230
230
  const fullPath = [...path, ...(issueData.path || [])];
@@ -346,7 +346,7 @@ exports.isAsync = isAsync;
346
346
 
347
347
  /***/ }),
348
348
 
349
- /***/ 160:
349
+ /***/ 163:
350
350
  /***/ ((__unused_webpack_module, exports) => {
351
351
 
352
352
 
@@ -355,7 +355,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
355
355
 
356
356
  /***/ }),
357
357
 
358
- /***/ 46:
358
+ /***/ 919:
359
359
  /***/ ((__unused_webpack_module, exports) => {
360
360
 
361
361
 
@@ -504,7 +504,7 @@ exports.getParsedType = getParsedType;
504
504
 
505
505
  /***/ }),
506
506
 
507
- /***/ 834:
507
+ /***/ 437:
508
508
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
509
509
 
510
510
 
@@ -536,21 +536,21 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
536
536
  };
537
537
  Object.defineProperty(exports, "__esModule", ({ value: true }));
538
538
  exports.z = void 0;
539
- const z = __importStar(__nccwpck_require__(831));
539
+ const z = __importStar(__nccwpck_require__(286));
540
540
  exports.z = z;
541
- __exportStar(__nccwpck_require__(831), exports);
541
+ __exportStar(__nccwpck_require__(286), exports);
542
542
  exports["default"] = z;
543
543
 
544
544
 
545
545
  /***/ }),
546
546
 
547
- /***/ 183:
547
+ /***/ 986:
548
548
  /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
549
549
 
550
550
 
551
551
  Object.defineProperty(exports, "__esModule", ({ value: true }));
552
- const util_1 = __nccwpck_require__(46);
553
- const ZodError_1 = __nccwpck_require__(705);
552
+ const util_1 = __nccwpck_require__(919);
553
+ const ZodError_1 = __nccwpck_require__(36);
554
554
  const errorMap = (issue, _ctx) => {
555
555
  let message;
556
556
  switch (issue.code) {
@@ -680,7 +680,7 @@ exports["default"] = errorMap;
680
680
 
681
681
  /***/ }),
682
682
 
683
- /***/ 735:
683
+ /***/ 796:
684
684
  /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
685
685
 
686
686
 
@@ -699,11 +699,11 @@ var _ZodEnum_cache, _ZodNativeEnum_cache;
699
699
  Object.defineProperty(exports, "__esModule", ({ value: true }));
700
700
  exports.boolean = exports.bigint = exports.array = exports.any = exports.coerce = exports.ZodFirstPartyTypeKind = exports.late = exports.ZodSchema = exports.Schema = exports.custom = exports.ZodReadonly = exports.ZodPipeline = exports.ZodBranded = exports.BRAND = exports.ZodNaN = exports.ZodCatch = exports.ZodDefault = exports.ZodNullable = exports.ZodOptional = exports.ZodTransformer = exports.ZodEffects = exports.ZodPromise = exports.ZodNativeEnum = exports.ZodEnum = exports.ZodLiteral = exports.ZodLazy = exports.ZodFunction = exports.ZodSet = exports.ZodMap = exports.ZodRecord = exports.ZodTuple = exports.ZodIntersection = exports.ZodDiscriminatedUnion = exports.ZodUnion = exports.ZodObject = exports.ZodArray = exports.ZodVoid = exports.ZodNever = exports.ZodUnknown = exports.ZodAny = exports.ZodNull = exports.ZodUndefined = exports.ZodSymbol = exports.ZodDate = exports.ZodBoolean = exports.ZodBigInt = exports.ZodNumber = exports.ZodString = exports.datetimeRegex = exports.ZodType = void 0;
701
701
  exports.NEVER = exports["void"] = exports.unknown = exports.union = exports.undefined = exports.tuple = exports.transformer = exports.symbol = exports.string = exports.strictObject = exports.set = exports.record = exports.promise = exports.preprocess = exports.pipeline = exports.ostring = exports.optional = exports.onumber = exports.oboolean = exports.object = exports.number = exports.nullable = exports["null"] = exports.never = exports.nativeEnum = exports.nan = exports.map = exports.literal = exports.lazy = exports.intersection = exports["instanceof"] = exports["function"] = exports["enum"] = exports.effect = exports.discriminatedUnion = exports.date = void 0;
702
- const errors_1 = __nccwpck_require__(503);
703
- const errorUtil_1 = __nccwpck_require__(266);
704
- const parseUtil_1 = __nccwpck_require__(707);
705
- const util_1 = __nccwpck_require__(46);
706
- const ZodError_1 = __nccwpck_require__(705);
702
+ const errors_1 = __nccwpck_require__(874);
703
+ const errorUtil_1 = __nccwpck_require__(121);
704
+ const parseUtil_1 = __nccwpck_require__(148);
705
+ const util_1 = __nccwpck_require__(919);
706
+ const ZodError_1 = __nccwpck_require__(36);
707
707
  class ParseInputLazyPath {
708
708
  constructor(parent, value, path, key) {
709
709
  this._cachedPath = [];
@@ -1117,15 +1117,15 @@ const base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z
1117
1117
  const dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
1118
1118
  const dateRegex = new RegExp(`^${dateRegexSource}$`);
1119
1119
  function timeRegexSource(args) {
1120
- // let regex = `\\d{2}:\\d{2}:\\d{2}`;
1121
- let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
1120
+ let secondsRegexSource = `[0-5]\\d`;
1122
1121
  if (args.precision) {
1123
- regex = `${regex}\\.\\d{${args.precision}}`;
1122
+ secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
1124
1123
  }
1125
1124
  else if (args.precision == null) {
1126
- regex = `${regex}(\\.\\d+)?`;
1125
+ secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
1127
1126
  }
1128
- return regex;
1127
+ const secondsQuantifier = args.precision ? "+" : "?"; // require seconds if precision is nonzero
1128
+ return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
1129
1129
  }
1130
1130
  function timeRegex(args) {
1131
1131
  return new RegExp(`^${timeRegexSource(args)}$`);
@@ -4575,7 +4575,7 @@ exports.NEVER = parseUtil_1.INVALID;
4575
4575
  /******/ // startup
4576
4576
  /******/ // Load entry module and return exports
4577
4577
  /******/ // This entry module is referenced by other modules so it can't be inlined
4578
- /******/ var __webpack_exports__ = __nccwpck_require__(834);
4578
+ /******/ var __webpack_exports__ = __nccwpck_require__(437);
4579
4579
  /******/ module.exports = __webpack_exports__;
4580
4580
  /******/
4581
4581
  /******/ })()
@@ -1 +1 @@
1
- {"name":"zod","author":"Colin McDonnell <colin@colinhacks.com>","version":"3.24.3","funding":"https://github.com/sponsors/colinhacks","license":"MIT","types":"./index.d.ts","type":"commonjs"}
1
+ {"name":"zod","author":"Colin McDonnell <colin@colinhacks.com>","version":"3.24.4","funding":"https://github.com/sponsors/colinhacks","license":"MIT","types":"./index.d.ts","type":"commonjs"}
@@ -11,7 +11,9 @@ export type HtmlRspackPluginHooks = {
11
11
  beforeAssetTagGeneration: liteTapable.AsyncSeriesWaterfallHook<[
12
12
  JsBeforeAssetTagGenerationData & ExtraPluginHookData
13
13
  ]>;
14
- alterAssetTags: liteTapable.AsyncSeriesWaterfallHook<[JsAlterAssetTagsData]>;
14
+ alterAssetTags: liteTapable.AsyncSeriesWaterfallHook<[
15
+ JsAlterAssetTagsData & ExtraPluginHookData
16
+ ]>;
15
17
  alterAssetTagGroups: liteTapable.AsyncSeriesWaterfallHook<[
16
18
  JsAlterAssetTagGroupsData & ExtraPluginHookData
17
19
  ]>;
@@ -72,8 +72,12 @@ export type HtmlRspackPluginOptions = {
72
72
  * If `true` then append a unique Rspack compilation hash to all included scripts and CSS files. This is useful for cache busting.
73
73
  */
74
74
  hash?: boolean;
75
+ /**
76
+ * Any other options will be passed by hooks.
77
+ */
78
+ [key: string]: any;
75
79
  };
76
80
  export declare function validateHtmlPluginOptions(options: HtmlRspackPluginOptions): string | null;
77
- export declare const getPluginOptions: (compilation: Compilation) => HtmlRspackPluginOptions | undefined;
78
- export declare const setPluginOptions: (compilation: Compilation, options: HtmlRspackPluginOptions) => void;
79
- export declare const cleanPluginOptions: (compilation: Compilation) => void;
81
+ export declare const getPluginOptions: (compilation: Compilation, uid: number) => any;
82
+ export declare const setPluginOptions: (compilation: Compilation, uid: number, options: HtmlRspackPluginOptions) => void;
83
+ export declare const cleanPluginOptions: (compilation: Compilation, uid: number) => void;
@@ -18,7 +18,6 @@ declare const HtmlRspackPlugin: typeof HtmlRspackPluginImpl & {
18
18
  */
19
19
  getHooks: (compilation: Compilation) => HtmlRspackPluginHooks;
20
20
  getCompilationHooks: (compilation: Compilation) => HtmlRspackPluginHooks;
21
- getCompilationOptions: (compilation: Compilation) => HtmlRspackPluginOptions | void;
22
21
  createHtmlTagObject: (tagName: string, attributes?: Record<string, string | boolean>, innerHTML?: string | undefined) => JsHtmlPluginTag;
23
22
  version: number;
24
23
  };
@@ -620,7 +620,7 @@ export type RuleSetRule = {
620
620
  resourceFragment?: RuleSetCondition;
621
621
  /** Matches all modules that match this resource against the Resource's query. */
622
622
  resourceQuery?: RuleSetCondition;
623
- /** Matches all modules that match this resource, and will match against the Resource's mimetype. */
623
+ /** Matches modules based on [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/MIME_types) instead of file extension. It's primarily useful for data URI module */
624
624
  mimetype?: RuleSetCondition;
625
625
  /** Matches all modules that match this resource, and will match against the Resource's scheme. */
626
626
  scheme?: RuleSetCondition;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import "./setupEnv";
1
2
  import * as rspackExports from "./exports";
2
3
  import { rspack as rspackFn } from "./rspack";
3
4
  type Rspack = typeof rspackFn & typeof rspackExports & {
package/dist/index.js CHANGED
@@ -418,6 +418,8 @@ for(var __webpack_i__ in (()=>{
418
418
  web: ()=>web,
419
419
  webworker: ()=>webworker
420
420
  });
421
+ var external_node_os_ = __webpack_require__("node:os");
422
+ "darwin" === __webpack_require__.n(external_node_os_)().platform() && void 0 === process.env.WATCHPACK_WATCHER_LIMIT && (process.env.WATCHPACK_WATCHER_LIMIT = "20");
421
423
  var binding_ = __webpack_require__("@rspack/binding"), binding_default = __webpack_require__.n(binding_);
422
424
  let lite_tapable_namespaceObject = require("@rspack/lite-tapable"), CHUNK_GROUP_MAPPINGS = new WeakMap();
423
425
  class ChunkGroup {
@@ -833,10 +835,10 @@ for(var __webpack_i__ in (()=>{
833
835
  return this.compilation.endTime;
834
836
  }
835
837
  hasErrors() {
836
- return this.#inner.hasErrors();
838
+ return this.#compilation.errors.length > 0 || this.#compilation.children.some((child)=>child.getStats().hasErrors());
837
839
  }
838
840
  hasWarnings() {
839
- return this.#inner.hasWarnings();
841
+ return this.#compilation.hooks.processWarnings.call(this.#compilation.warnings).length > 0 || this.#compilation.children.some((child)=>child.getStats().hasWarnings());
840
842
  }
841
843
  toJson(opts, forToString) {
842
844
  let options = this.compilation.createStatsOptions(opts, {
@@ -1858,11 +1860,14 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
1858
1860
  inner.spliceDiagnostic(0, length, errors.map((error)=>JsRspackDiagnostic.__to_binding(error, binding_.JsRspackSeverity.Error)));
1859
1861
  }
1860
1862
  get warnings() {
1861
- let inner = this.#inner, processWarningsHook = this.hooks.processWarnings, warnings = inner.getWarnings();
1863
+ let inner = this.#inner, warnings = inner.getWarnings();
1862
1864
  for (let item of [
1863
1865
  {
1864
1866
  method: "push",
1865
- handler: (target, thisArg, warns)=>Reflect.apply(target, thisArg, processWarningsHook.call(warns).map((warn)=>(inner.pushDiagnostic(JsRspackDiagnostic.__to_binding(warn, binding_.JsRspackSeverity.Warn)), warn)))
1867
+ handler (target, thisArg, warns) {
1868
+ for (let warn of warns)inner.pushDiagnostic(JsRspackDiagnostic.__to_binding(warn, binding_.JsRspackSeverity.Warn));
1869
+ return Reflect.apply(target, thisArg, warns);
1870
+ }
1866
1871
  },
1867
1872
  {
1868
1873
  method: "pop",
@@ -1874,15 +1879,12 @@ BREAKING CHANGE: Asset processing hooks in Compilation has been merged into a si
1874
1879
  },
1875
1880
  {
1876
1881
  method: "unshift",
1877
- handler (target, thisArg, warns) {
1878
- let warnings = processWarningsHook.call(warns);
1879
- return inner.spliceDiagnostic(0, 0, warnings.map((warn)=>JsRspackDiagnostic.__to_binding(warn, binding_.JsRspackSeverity.Warn))), Reflect.apply(target, thisArg, warnings);
1880
- }
1882
+ handler: (target, thisArg, warns)=>(inner.spliceDiagnostic(0, 0, warns.map((warn)=>JsRspackDiagnostic.__to_binding(warn, binding_.JsRspackSeverity.Warn))), Reflect.apply(target, thisArg, warns))
1881
1883
  },
1882
1884
  {
1883
1885
  method: "splice",
1884
1886
  handler (target, thisArg, [startIdx, delCount, ...warns]) {
1885
- let warnList = (warns = processWarningsHook.call(warns)).map((warn)=>JsRspackDiagnostic.__to_binding(warn, binding_.JsRspackSeverity.Warn));
1887
+ let warnList = warns.map((warn)=>JsRspackDiagnostic.__to_binding(warn, binding_.JsRspackSeverity.Warn));
1886
1888
  return inner.spliceDiagnostic(startIdx, startIdx + delCount, warnList), Reflect.apply(target, thisArg, [
1887
1889
  startIdx,
1888
1890
  delCount,
@@ -4844,7 +4846,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4844
4846
  return !1;
4845
4847
  }
4846
4848
  }
4847
- let compilationOptionsMap = new WeakMap(), templateRenderFunction = zod_index_js_namespaceObject.z.function().args(zod_index_js_namespaceObject.z.record(zod_index_js_namespaceObject.z.string(), zod_index_js_namespaceObject.z.any())).returns(zod_index_js_namespaceObject.z.string().or(zod_index_js_namespaceObject.z.promise(zod_index_js_namespaceObject.z.string()))), templateParamFunction = zod_index_js_namespaceObject.z.function().args(zod_index_js_namespaceObject.z.record(zod_index_js_namespaceObject.z.string(), zod_index_js_namespaceObject.z.any())).returns(zod_index_js_namespaceObject.z.record(zod_index_js_namespaceObject.z.string(), zod_index_js_namespaceObject.z.any()).or(zod_index_js_namespaceObject.z.promise(zod_index_js_namespaceObject.z.record(zod_index_js_namespaceObject.z.string(), zod_index_js_namespaceObject.z.any())))), templateFilenameFunction = zod_index_js_namespaceObject.z.function().args(zod_index_js_namespaceObject.z.string()).returns(zod_index_js_namespaceObject.z.string()), pluginOptionsSchema = zod_index_js_namespaceObject.z.strictObject({
4849
+ let compilationOptionsMap = new WeakMap(), templateRenderFunction = zod_index_js_namespaceObject.z.function().args(zod_index_js_namespaceObject.z.record(zod_index_js_namespaceObject.z.string(), zod_index_js_namespaceObject.z.any())).returns(zod_index_js_namespaceObject.z.string().or(zod_index_js_namespaceObject.z.promise(zod_index_js_namespaceObject.z.string()))), templateParamFunction = zod_index_js_namespaceObject.z.function().args(zod_index_js_namespaceObject.z.record(zod_index_js_namespaceObject.z.string(), zod_index_js_namespaceObject.z.any())).returns(zod_index_js_namespaceObject.z.record(zod_index_js_namespaceObject.z.string(), zod_index_js_namespaceObject.z.any()).or(zod_index_js_namespaceObject.z.promise(zod_index_js_namespaceObject.z.record(zod_index_js_namespaceObject.z.string(), zod_index_js_namespaceObject.z.any())))), templateFilenameFunction = zod_index_js_namespaceObject.z.function().args(zod_index_js_namespaceObject.z.string()).returns(zod_index_js_namespaceObject.z.string()), pluginOptionsSchema = zod_index_js_namespaceObject.z.object({
4848
4850
  filename: zod_index_js_namespaceObject.z.string().or(templateFilenameFunction).optional(),
4849
4851
  template: zod_index_js_namespaceObject.z.string().refine((val)=>!val.includes("!"), ()=>({
4850
4852
  message: "HtmlRspackPlugin does not support template path with loader yet"
@@ -4887,14 +4889,19 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4887
4889
  favicon: zod_index_js_namespaceObject.z.string().optional(),
4888
4890
  meta: zod_index_js_namespaceObject.z.record(zod_index_js_namespaceObject.z.string().or(zod_index_js_namespaceObject.z.record(zod_index_js_namespaceObject.z.string()))).optional(),
4889
4891
  hash: zod_index_js_namespaceObject.z.boolean().optional()
4890
- }), setPluginOptions = (compilation, options)=>{
4891
- compilationOptionsMap.set(compilation, options);
4892
- }, cleanPluginOptions = (compilation)=>{
4893
- compilationOptionsMap.delete(compilation);
4894
- }, HtmlRspackPluginImpl = base_create(binding_.BuiltinPluginName.HtmlRspackPlugin, function(c = {}) {
4892
+ }), getPluginOptions = (compilation, uid)=>{
4893
+ if (!(compilation instanceof Compilation)) throw TypeError("The 'compilation' argument must be an instance of Compilation");
4894
+ return compilationOptionsMap.get(compilation)?.[uid];
4895
+ }, setPluginOptions = (compilation, uid, options)=>{
4896
+ let optionsMap = compilationOptionsMap.get(compilation) || {};
4897
+ optionsMap[uid] = options, compilationOptionsMap.set(compilation, optionsMap);
4898
+ }, cleanPluginOptions = (compilation, uid)=>{
4899
+ let optionsMap = compilationOptionsMap.get(compilation) || {};
4900
+ delete optionsMap[uid], 0 === Object.keys(optionsMap).length ? compilationOptionsMap.delete(compilation) : compilationOptionsMap.set(compilation, optionsMap);
4901
+ }, HTML_PLUGIN_UID = 0, HtmlRspackPluginImpl = base_create(binding_.BuiltinPluginName.HtmlRspackPlugin, function(c = {}) {
4895
4902
  let templateParameters, templateFn, filenames;
4896
4903
  validate(c, pluginOptionsSchema);
4897
- let meta = {};
4904
+ let uid = HTML_PLUGIN_UID++, meta = {};
4898
4905
  for(let key in c.meta){
4899
4906
  let value = c.meta[key];
4900
4907
  "string" == typeof value ? meta[key] = {
@@ -4931,9 +4938,9 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4931
4938
  return json;
4932
4939
  }
4933
4940
  this.hooks.compilation.tap("HtmlRspackPlugin", (compilationInstance)=>{
4934
- setPluginOptions(compilation = compilationInstance, c);
4941
+ setPluginOptions(compilation = compilationInstance, uid, c);
4935
4942
  }), this.hooks.done.tap("HtmlRspackPlugin", (stats)=>{
4936
- cleanPluginHooks(stats.compilation), cleanPluginOptions(stats.compilation);
4943
+ cleanPluginHooks(stats.compilation), cleanPluginOptions(stats.compilation, uid);
4937
4944
  });
4938
4945
  let templateContent = c.templateContent;
4939
4946
  if ("function" == typeof templateContent) templateFn = async (data)=>{
@@ -4988,7 +4995,8 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
4988
4995
  base,
4989
4996
  templateFn,
4990
4997
  templateContent,
4991
- templateParameters
4998
+ templateParameters,
4999
+ uid
4992
5000
  };
4993
5001
  }), HtmlRspackPlugin = HtmlRspackPluginImpl, voidTags = [
4994
5002
  "area",
@@ -5012,10 +5020,7 @@ Plugins which provide custom chunk loading types must call EnableChunkLoadingPlu
5012
5020
  voidTag: voidTags.includes(tagName),
5013
5021
  attributes: attributes || {},
5014
5022
  innerHTML
5015
- }), HtmlRspackPlugin.getCompilationOptions = (compilation)=>{
5016
- if (!(compilation instanceof Compilation)) throw TypeError("The 'compilation' argument must be an instance of Compilation");
5017
- return compilationOptionsMap.get(compilation);
5018
- }, HtmlRspackPlugin.getHooks = HtmlRspackPlugin.getCompilationHooks = (compilation)=>{
5023
+ }), HtmlRspackPlugin.getHooks = HtmlRspackPlugin.getCompilationHooks = (compilation)=>{
5019
5024
  checkCompilation(compilation);
5020
5025
  let hooks = hooks_compilationHooksMap.get(compilation);
5021
5026
  return void 0 === hooks && (hooks = {
@@ -6495,7 +6500,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
6495
6500
  }, applyExperimentsDefaults = (experiments, { production, development })=>{
6496
6501
  F(experiments, "cache", ()=>development), D(experiments, "futureDefaults", !1), D(experiments, "lazyCompilation", !1), D(experiments, "asyncWebAssembly", experiments.futureDefaults), D(experiments, "css", !!experiments.futureDefaults || void 0), D(experiments, "layers", !1), D(experiments, "topLevelAwait", !0), D(experiments, "buildHttp", void 0), experiments.buildHttp && "object" == typeof experiments.buildHttp && D(experiments.buildHttp, "upgrade", !1), D(experiments, "incremental", {}), "object" == typeof experiments.incremental && (D(experiments.incremental, "silent", !0), D(experiments.incremental, "make", !0), D(experiments.incremental, "inferAsyncModules", !1), D(experiments.incremental, "providedExports", !1), D(experiments.incremental, "dependenciesDiagnostics", !1), D(experiments.incremental, "sideEffects", !1), D(experiments.incremental, "buildChunkGraph", !1), D(experiments.incremental, "moduleIds", !1), D(experiments.incremental, "chunkIds", !1), D(experiments.incremental, "modulesHashes", !1), D(experiments.incremental, "modulesCodegen", !1), D(experiments.incremental, "modulesRuntimeRequirements", !1), D(experiments.incremental, "chunksRuntimeRequirements", !1), D(experiments.incremental, "chunksHashes", !1), D(experiments.incremental, "chunksRender", !1), D(experiments.incremental, "emitAssets", !0)), D(experiments, "rspackFuture", {}), D(experiments, "parallelCodeSplitting", !0), D(experiments, "parallelLoader", !1);
6497
6502
  }, applybundlerInfoDefaults = (rspackFuture, library)=>{
6498
- "object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.3.8"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
6503
+ "object" == typeof rspackFuture && (D(rspackFuture, "bundlerInfo", {}), "object" == typeof rspackFuture.bundlerInfo && (D(rspackFuture.bundlerInfo, "version", "1.3.9"), D(rspackFuture.bundlerInfo, "bundler", "rspack"), D(rspackFuture.bundlerInfo, "force", !library)));
6499
6504
  }, applySnapshotDefaults = (_snapshot, _env)=>{}, applyJavascriptParserOptionsDefaults = (parserOptions)=>{
6500
6505
  D(parserOptions, "dynamicImportMode", "lazy"), D(parserOptions, "dynamicImportPrefetch", !1), D(parserOptions, "dynamicImportPreload", !1), D(parserOptions, "url", !0), D(parserOptions, "exprContextCritical", !0), D(parserOptions, "wrappedContextCritical", !1), D(parserOptions, "wrappedContextRegExp", /.*/), D(parserOptions, "strictExportPresence", !1), D(parserOptions, "requireAsExpression", !0), D(parserOptions, "requireDynamic", !0), D(parserOptions, "requireResolve", !0), D(parserOptions, "importDynamic", !0), D(parserOptions, "worker", [
6501
6506
  "..."
@@ -7398,7 +7403,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
7398
7403
  },
7399
7404
  arm: "gnueabihf"
7400
7405
  }
7401
- }, BINDING_VERSION = __webpack_require__("@rspack/binding/package.json").version, CORE_VERSION = "1.3.8", getAddonPlatformArchAbi = ()=>{
7406
+ }, BINDING_VERSION = __webpack_require__("@rspack/binding/package.json").version, CORE_VERSION = "1.3.9", getAddonPlatformArchAbi = ()=>{
7402
7407
  let { platform, arch } = process, binding = "";
7403
7408
  binding += platform;
7404
7409
  let abi = NodePlatformArchToAbi[platform][arch];
@@ -7450,49 +7455,56 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
7450
7455
  BINDING_VERSION,
7451
7456
  ADDON_VERSION
7452
7457
  ].every((v, _, arr)=>v === arr[0]) ? null : Error(`Unmatched version @rspack/core@${CORE_VERSION}, @rspack/binding@${BINDING_VERSION}, @rspack/binding-${platformArchAbi}@${ADDON_VERSION}.\nRspack requires these versions to be the same or you may have installed the wrong version. Otherwise, Rspack may not work properly.`);
7453
- }, createHtmlPluginHooksRegisters = (getCompiler, createTap, createMapTap)=>({
7458
+ }, createHtmlPluginHooksRegisters = (getCompiler, createTap, createMapTap)=>{
7459
+ let getOptions = (uid)=>getPluginOptions(getCompiler().__internal__get_compilation(), uid);
7460
+ return {
7454
7461
  registerHtmlPluginBeforeAssetTagGenerationTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginBeforeAssetTagGeneration, function() {
7455
7462
  return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).beforeAssetTagGeneration;
7456
7463
  }, function(queried) {
7457
7464
  return async function(data) {
7458
- let compilationId = data.compilationId, res = await queried.promise({
7465
+ let { compilationId, uid } = data, res = await queried.promise({
7459
7466
  ...data,
7460
7467
  plugin: {
7461
- options: HtmlRspackPlugin.getCompilationOptions(getCompiler().__internal__get_compilation()) || {}
7468
+ options: getOptions(uid)
7462
7469
  }
7463
7470
  });
7464
- return res.compilationId = compilationId, res;
7471
+ return res.compilationId = compilationId, res.uid = uid, res;
7465
7472
  };
7466
7473
  }),
7467
7474
  registerHtmlPluginAlterAssetTagsTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAlterAssetTags, function() {
7468
7475
  return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).alterAssetTags;
7469
7476
  }, function(queried) {
7470
7477
  return async function(data) {
7471
- let compilationId = data.compilationId, res = await queried.promise(data);
7472
- return res.compilationId = compilationId, res;
7478
+ let { compilationId, uid } = data, res = await queried.promise({
7479
+ ...data,
7480
+ plugin: {
7481
+ options: getOptions(uid)
7482
+ }
7483
+ });
7484
+ return res.compilationId = compilationId, res.uid = uid, res;
7473
7485
  };
7474
7486
  }),
7475
7487
  registerHtmlPluginAlterAssetTagGroupsTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAlterAssetTagGroups, function() {
7476
7488
  return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).alterAssetTagGroups;
7477
7489
  }, function(queried) {
7478
7490
  return async function(data) {
7479
- let compilationId = data.compilationId, res = await queried.promise({
7491
+ let { compilationId, uid } = data, res = await queried.promise({
7480
7492
  ...data,
7481
7493
  plugin: {
7482
- options: HtmlRspackPlugin.getCompilationOptions(getCompiler().__internal__get_compilation()) || {}
7494
+ options: getOptions(uid)
7483
7495
  }
7484
7496
  });
7485
- return res.compilationId = compilationId, res;
7497
+ return res.compilationId = compilationId, res.uid = uid, res;
7486
7498
  };
7487
7499
  }),
7488
7500
  registerHtmlPluginAfterTemplateExecutionTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAfterTemplateExecution, function() {
7489
7501
  return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).afterTemplateExecution;
7490
7502
  }, function(queried) {
7491
7503
  return async function(data) {
7492
- let compilationId = data.compilationId, res = await queried.promise({
7504
+ let { compilationId, uid } = data, res = await queried.promise({
7493
7505
  ...data,
7494
7506
  plugin: {
7495
- options: HtmlRspackPlugin.getCompilationOptions(getCompiler().__internal__get_compilation()) || {}
7507
+ options: getOptions(uid)
7496
7508
  }
7497
7509
  });
7498
7510
  return res.compilationId = compilationId, res;
@@ -7502,29 +7514,30 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
7502
7514
  return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).beforeEmit;
7503
7515
  }, function(queried) {
7504
7516
  return async function(data) {
7505
- let compilationId = data.compilationId, res = await queried.promise({
7517
+ let { compilationId, uid } = data, res = await queried.promise({
7506
7518
  ...data,
7507
7519
  plugin: {
7508
- options: HtmlRspackPlugin.getCompilationOptions(getCompiler().__internal__get_compilation()) || {}
7520
+ options: getOptions(uid)
7509
7521
  }
7510
7522
  });
7511
- return res.compilationId = compilationId, res;
7523
+ return res.compilationId = compilationId, res.uid = uid, res;
7512
7524
  };
7513
7525
  }),
7514
7526
  registerHtmlPluginAfterEmitTaps: createTap(binding_.RegisterJsTapKind.HtmlPluginAfterEmit, function() {
7515
7527
  return HtmlRspackPlugin.getCompilationHooks(getCompiler().__internal__get_compilation()).afterEmit;
7516
7528
  }, function(queried) {
7517
7529
  return async function(data) {
7518
- let compilationId = data.compilationId, res = await queried.promise({
7530
+ let { compilationId, uid } = data, res = await queried.promise({
7519
7531
  ...data,
7520
7532
  plugin: {
7521
- options: HtmlRspackPlugin.getCompilationOptions(getCompiler().__internal__get_compilation()) || {}
7533
+ options: getOptions(uid)
7522
7534
  }
7523
7535
  });
7524
- return res.compilationId = compilationId, res;
7536
+ return res.compilationId = compilationId, res.uid = uid, res;
7525
7537
  };
7526
7538
  })
7527
- });
7539
+ };
7540
+ };
7528
7541
  class ContextModuleFactoryBeforeResolveData {
7529
7542
  #inner;
7530
7543
  static __from_binding(binding) {
@@ -8568,7 +8581,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
8568
8581
  obj.children = this.stats.map((stat, idx)=>{
8569
8582
  let obj = stat.toJson(childOptions.children[idx]), compilationName = stat.compilation.name;
8570
8583
  return obj.name = compilationName && makePathsRelative(childOptions.context, compilationName, stat.compilation.compiler.root), obj;
8571
- }), childOptions.version && (obj.rspackVersion = "1.3.8", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
8584
+ }), childOptions.version && (obj.rspackVersion = "1.3.9", obj.version = "5.75.0"), childOptions.hash && (obj.hash = obj.children.map((j)=>j.hash).join(""));
8572
8585
  let mapError = (j, obj)=>({
8573
8586
  ...obj,
8574
8587
  compilerPath: obj.compilerPath ? `${j.name}.${obj.compilerPath}` : j.name
@@ -8950,7 +8963,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
8950
8963
  } else items.push(itemOrGroup);
8951
8964
  if (groupsSize + items.length <= max) children = groups.length > 0 ? groups.concat(items) : items;
8952
8965
  else if (0 === groups.length) {
8953
- let limit = max - +!filteredChildrenLineReserved;
8966
+ let limit = max - !filteredChildrenLineReserved;
8954
8967
  filteredChildren = items.length - limit, items.length = limit, children = items;
8955
8968
  } else {
8956
8969
  let limit = groups.length + (filteredChildrenLineReserved || 0 === items.length ? 0 : 1);
@@ -9059,6 +9072,9 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
9059
9072
  errors: result,
9060
9073
  filtered
9061
9074
  };
9075
+ }, warningFromStatsWarning = (warning)=>{
9076
+ let res = Error(warning.message);
9077
+ return res.name = warning.name || "StatsWarning", Object.assign(res, warning), res;
9062
9078
  }, GROUP_EXTENSION_REGEXP = /(\.[^.]+?)(?:\?|(?: \+ \d+ modules?)?$)/, GROUP_PATH_REGEXP = /(.+)[/\\][^/\\]+?(?:\?|(?: \+ \d+ modules?)?$)/, ITEM_NAMES = {
9063
9079
  "compilation.children[]": "compilation",
9064
9080
  "compilation.modules[]": "module",
@@ -9361,10 +9377,21 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
9361
9377
  compilation: {
9362
9378
  _: (object, compilation, context, options)=>{
9363
9379
  let statsCompilation = context.getStatsCompilation(compilation);
9364
- context.makePathsRelative || (context.makePathsRelative = makePathsRelative.bindContextCache(compilation.compiler.context, compilation.compiler.root)), context.cachedGetErrors || (context.cachedGetErrors = (_compilation)=>statsCompilation.errors), context.cachedGetWarnings || (context.cachedGetWarnings = (_compilation)=>{
9365
- let warnings = statsCompilation.warnings;
9366
- return compilation.hooks.processWarnings.call(warnings);
9367
- }), compilation.name && (object.name = compilation.name);
9380
+ if (context.makePathsRelative || (context.makePathsRelative = makePathsRelative.bindContextCache(compilation.compiler.context, compilation.compiler.root)), !context.cachedGetErrors) {
9381
+ let map = new WeakMap();
9382
+ context.cachedGetErrors = (compilation)=>{
9383
+ var errors;
9384
+ return map.get(compilation) || (errors = statsCompilation.errors, map.set(compilation, errors), errors);
9385
+ };
9386
+ }
9387
+ if (!context.cachedGetWarnings) {
9388
+ let map = new WeakMap();
9389
+ context.cachedGetWarnings = (compilation)=>{
9390
+ var warnings;
9391
+ return map.get(compilation) || (warnings = compilation.hooks.processWarnings.call(statsCompilation.warnings.map(warningFromStatsWarning)), map.set(compilation, warnings), warnings);
9392
+ };
9393
+ }
9394
+ compilation.name && (object.name = compilation.name);
9368
9395
  let logging = options.logging, loggingDebug = options.loggingDebug, loggingTrace = options.loggingTrace;
9369
9396
  if (logging || loggingDebug && loggingDebug.length > 0) {
9370
9397
  let acceptedTypes, collapsedGroups = !1;
@@ -9444,7 +9471,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
9444
9471
  object.hash = context.getStatsCompilation(compilation).hash;
9445
9472
  },
9446
9473
  version: (object)=>{
9447
- object.version = "5.75.0", object.rspackVersion = "1.3.8";
9474
+ object.version = "5.75.0", object.rspackVersion = "1.3.9";
9448
9475
  },
9449
9476
  env: (object, _compilation, _context, { _env })=>{
9450
9477
  object.env = _env;
@@ -13103,7 +13130,7 @@ You can also more options via the 'target' option: 'browserslist' / 'browserslis
13103
13130
  let _options = JSON.stringify(options || {});
13104
13131
  return binding_default().transform(source, _options);
13105
13132
  }
13106
- let exports_rspackVersion = "1.3.8", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
13133
+ let exports_rspackVersion = "1.3.9", exports_version = "5.75.0", exports_WebpackError = Error, sources = __webpack_require__("webpack-sources"), exports_config = {
13107
13134
  getNormalizedRspackOptions: getNormalizedRspackOptions,
13108
13135
  applyRspackOptionsDefaults: applyRspackOptionsDefaults,
13109
13136
  getNormalizedWebpackOptions: getNormalizedRspackOptions,
@@ -0,0 +1 @@
1
+ export {};
@@ -301,4 +301,5 @@ export declare const errorsSpaceLimit: (errors: StatsError[], max: number) => {
301
301
  errors: StatsError[];
302
302
  filtered: number;
303
303
  };
304
+ export declare const warningFromStatsWarning: (warning: binding.JsStatsWarning) => Error;
304
305
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rspack/core",
3
- "version": "1.3.8",
3
+ "version": "1.3.9",
4
4
  "webpackVersion": "5.75.0",
5
5
  "license": "MIT",
6
6
  "description": "The fast Rust-based web bundler with webpack-compatible API",
@@ -37,29 +37,29 @@
37
37
  "directory": "packages/rspack"
38
38
  },
39
39
  "devDependencies": {
40
- "@swc/core": "1.11.21",
40
+ "@swc/core": "1.11.24",
41
41
  "@swc/types": "0.1.21",
42
- "@rslib/core": "0.6.7",
42
+ "@rslib/core": "0.6.8",
43
43
  "@types/graceful-fs": "4.1.9",
44
44
  "@types/watchpack": "^2.4.4",
45
45
  "@types/webpack-sources": "3.2.3",
46
- "browserslist": "^4.24.4",
46
+ "browserslist": "^4.24.5",
47
47
  "enhanced-resolve": "5.18.1",
48
48
  "graceful-fs": "^4.2.11",
49
49
  "prebundle": "^1.3.3",
50
- "tsx": "^4.19.3",
50
+ "tsx": "^4.19.4",
51
51
  "typescript": "^5.8.3",
52
52
  "watchpack": "^2.4.2",
53
53
  "webpack-sources": "3.2.3",
54
- "zod": "^3.24.3",
55
- "zod-validation-error": "3.4.0",
54
+ "zod": "^3.24.4",
55
+ "zod-validation-error": "3.4.1",
56
56
  "tinypool": "^1.0.2"
57
57
  },
58
58
  "dependencies": {
59
- "@module-federation/runtime-tools": "0.13.0",
59
+ "@module-federation/runtime-tools": "0.13.1",
60
60
  "@rspack/lite-tapable": "1.0.1",
61
- "caniuse-lite": "^1.0.30001715",
62
- "@rspack/binding": "1.3.8"
61
+ "caniuse-lite": "^1.0.30001717",
62
+ "@rspack/binding": "1.3.9"
63
63
  },
64
64
  "peerDependencies": {
65
65
  "@swc/helpers": ">=0.5.1"