@rolldown/browser 1.0.0-beta.29 → 1.0.0-beta.30

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 (41) hide show
  1. package/dist/cli.cjs +9 -9
  2. package/dist/cli.mjs +8 -8
  3. package/dist/config.cjs +3 -3
  4. package/dist/config.d.cts +2 -2
  5. package/dist/config.d.mts +2 -2
  6. package/dist/config.mjs +3 -3
  7. package/dist/experimental-index.browser.mjs +2 -2
  8. package/dist/experimental-index.cjs +2 -3
  9. package/dist/experimental-index.d.cts +3 -3
  10. package/dist/experimental-index.d.mts +3 -3
  11. package/dist/experimental-index.mjs +3 -3
  12. package/dist/filter-index.d.cts +2 -2
  13. package/dist/filter-index.d.mts +2 -2
  14. package/dist/index.browser.mjs +1 -1
  15. package/dist/index.cjs +2 -2
  16. package/dist/index.d.cts +3 -3
  17. package/dist/index.d.mts +3 -3
  18. package/dist/index.mjs +2 -2
  19. package/dist/parallel-plugin-worker.cjs +2 -2
  20. package/dist/parallel-plugin-worker.mjs +2 -2
  21. package/dist/parallel-plugin.d.cts +2 -2
  22. package/dist/parallel-plugin.d.mts +2 -2
  23. package/dist/parse-ast-index.cjs +1 -1
  24. package/dist/parse-ast-index.d.cts +1 -1
  25. package/dist/parse-ast-index.d.mts +1 -1
  26. package/dist/parse-ast-index.mjs +1 -1
  27. package/dist/rolldown-binding.wasi-browser.js +0 -1
  28. package/dist/rolldown-binding.wasi.cjs +0 -1
  29. package/dist/rolldown-binding.wasm32-wasi.wasm +0 -0
  30. package/dist/shared/{binding-BO7hG1pA.d.mts → binding-BAyrv67G.d.cts} +29 -45
  31. package/dist/shared/{binding-D1lW862e.d.cts → binding-DUz1Q2JW.d.mts} +29 -45
  32. package/dist/shared/{define-config-BzINvTeZ.d.mts → define-config-5ALh7WDx.d.mts} +72 -9
  33. package/dist/shared/{define-config-CbNA0bsF.d.cts → define-config-CMH1jWhX.d.cts} +72 -9
  34. package/dist/shared/{load-config-Db6nl6MU.mjs → load-config-Uk19Sezh.mjs} +2 -2
  35. package/dist/shared/{load-config-BzLcyKpK.cjs → load-config-XQT0YfAt.cjs} +2 -2
  36. package/dist/shared/{parse-ast-index-rwZvDBjW.mjs → parse-ast-index-Z-sG_A0I.mjs} +2 -2
  37. package/dist/shared/{parse-ast-index-CLjgl4c8.cjs → parse-ast-index-ZiMOspE_.cjs} +2 -2
  38. package/dist/shared/{src-CkSl8yxM.cjs → src-CXCXfLrc.cjs} +89 -136
  39. package/dist/shared/{src-BN28iHET.mjs → src-CkG0t1KT.mjs} +90 -131
  40. package/dist/{src-DynJfHII.js → src-DGzv-S-Z.js} +58 -46
  41. package/package.json +2 -2
@@ -1,14 +1,15 @@
1
1
  const require_chunk = require('./chunk-DDkG_k5U.cjs');
2
2
  const require_dist = require('./dist-BVAp8sOm.cjs');
3
- const require_parse_ast_index = require('./parse-ast-index-CLjgl4c8.cjs');
3
+ const require_parse_ast_index = require('./parse-ast-index-ZiMOspE_.cjs');
4
4
  const src_rolldown_binding_wasi_cjs = require_chunk.__toESM(require("../rolldown-binding.wasi.cjs"));
5
5
  const node_path = require_chunk.__toESM(require("node:path"));
6
6
  const node_url = require_chunk.__toESM(require("node:url"));
7
+ const node_fs_promises = require_chunk.__toESM(require("node:fs/promises"));
7
8
  const node_os = require_chunk.__toESM(require("node:os"));
8
9
  const node_worker_threads = require_chunk.__toESM(require("node:worker_threads"));
9
10
 
10
11
  //#region package.json
11
- var version = "1.0.0-beta.29";
12
+ var version = "1.0.0-beta.30";
12
13
  var description$1 = "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.";
13
14
 
14
15
  //#endregion
@@ -87,27 +88,6 @@ function viteResolvePlugin(config) {
87
88
  const builtinPlugin = new BuiltinPlugin("builtin:vite-resolve", config);
88
89
  return makeBuiltinPluginCallable(builtinPlugin);
89
90
  }
90
- function moduleFederationPlugin(config) {
91
- return new BuiltinPlugin("builtin:module-federation", {
92
- ...config,
93
- remotes: config.remotes && Object.entries(config.remotes).map(([name, remote]) => {
94
- if (typeof remote === "string") {
95
- const [entryGlobalName] = remote.split("@");
96
- const entry = remote.replace(entryGlobalName + "@", "");
97
- return {
98
- entry,
99
- name,
100
- entryGlobalName
101
- };
102
- }
103
- return {
104
- ...remote,
105
- name: remote.name ?? name
106
- };
107
- }),
108
- manifest: config.manifest === false ? void 0 : config.manifest === true ? {} : config.manifest
109
- });
110
- }
111
91
  function isolatedDeclarationPlugin(config) {
112
92
  return new BuiltinPlugin("builtin:isolated-declaration", config);
113
93
  }
@@ -1451,10 +1431,9 @@ function addError(errors, message) {
1451
1431
  function handleError(message, config) {
1452
1432
  switch (config?.errorMode) {
1453
1433
  case "ignore": break;
1454
- case "warn": {
1434
+ case "warn":
1455
1435
  console.warn(message);
1456
1436
  break;
1457
- }
1458
1437
  default: throw new Error(message);
1459
1438
  }
1460
1439
  }
@@ -1471,10 +1450,9 @@ function convertAction(jsonSchema, valibotAction, config) {
1471
1450
  if (config?.ignoreActions?.includes(valibotAction.type)) return jsonSchema;
1472
1451
  let errors;
1473
1452
  switch (valibotAction.type) {
1474
- case "base64": {
1453
+ case "base64":
1475
1454
  jsonSchema.contentEncoding = "base64";
1476
1455
  break;
1477
- }
1478
1456
  case "bic":
1479
1457
  case "cuid2":
1480
1458
  case "decimal":
@@ -1484,57 +1462,46 @@ function convertAction(jsonSchema, valibotAction, config) {
1484
1462
  case "hex_color":
1485
1463
  case "nanoid":
1486
1464
  case "octal":
1487
- case "ulid": {
1465
+ case "ulid":
1488
1466
  jsonSchema.pattern = valibotAction.requirement.source;
1489
1467
  break;
1490
- }
1491
- case "description": {
1468
+ case "description":
1492
1469
  jsonSchema.description = valibotAction.description;
1493
1470
  break;
1494
- }
1495
- case "email": {
1471
+ case "email":
1496
1472
  jsonSchema.format = "email";
1497
1473
  break;
1498
- }
1499
- case "empty": {
1474
+ case "empty":
1500
1475
  if (jsonSchema.type === "array") jsonSchema.maxItems = 0;
1501
1476
  else {
1502
1477
  if (jsonSchema.type !== "string") errors = addError(errors, `The "${valibotAction.type}" action is not supported on type "${jsonSchema.type}".`);
1503
1478
  jsonSchema.maxLength = 0;
1504
1479
  }
1505
1480
  break;
1506
- }
1507
- case "entries": {
1481
+ case "entries":
1508
1482
  jsonSchema.minProperties = valibotAction.requirement;
1509
1483
  jsonSchema.maxProperties = valibotAction.requirement;
1510
1484
  break;
1511
- }
1512
- case "integer": {
1485
+ case "integer":
1513
1486
  jsonSchema.type = "integer";
1514
1487
  break;
1515
- }
1516
- case "ipv4": {
1488
+ case "ipv4":
1517
1489
  jsonSchema.format = "ipv4";
1518
1490
  break;
1519
- }
1520
- case "ipv6": {
1491
+ case "ipv6":
1521
1492
  jsonSchema.format = "ipv6";
1522
1493
  break;
1523
- }
1524
- case "iso_date": {
1494
+ case "iso_date":
1525
1495
  jsonSchema.format = "date";
1526
1496
  break;
1527
- }
1528
1497
  case "iso_date_time":
1529
- case "iso_timestamp": {
1498
+ case "iso_timestamp":
1530
1499
  jsonSchema.format = "date-time";
1531
1500
  break;
1532
- }
1533
- case "iso_time": {
1501
+ case "iso_time":
1534
1502
  jsonSchema.format = "time";
1535
1503
  break;
1536
- }
1537
- case "length": {
1504
+ case "length":
1538
1505
  if (jsonSchema.type === "array") {
1539
1506
  jsonSchema.minItems = valibotAction.requirement;
1540
1507
  jsonSchema.maxItems = valibotAction.requirement;
@@ -1544,80 +1511,65 @@ function convertAction(jsonSchema, valibotAction, config) {
1544
1511
  jsonSchema.maxLength = valibotAction.requirement;
1545
1512
  }
1546
1513
  break;
1547
- }
1548
- case "max_entries": {
1514
+ case "max_entries":
1549
1515
  jsonSchema.maxProperties = valibotAction.requirement;
1550
1516
  break;
1551
- }
1552
- case "max_length": {
1517
+ case "max_length":
1553
1518
  if (jsonSchema.type === "array") jsonSchema.maxItems = valibotAction.requirement;
1554
1519
  else {
1555
1520
  if (jsonSchema.type !== "string") errors = addError(errors, `The "${valibotAction.type}" action is not supported on type "${jsonSchema.type}".`);
1556
1521
  jsonSchema.maxLength = valibotAction.requirement;
1557
1522
  }
1558
1523
  break;
1559
- }
1560
- case "max_value": {
1524
+ case "max_value":
1561
1525
  if (jsonSchema.type !== "number") errors = addError(errors, `The "max_value" action is not supported on type "${jsonSchema.type}".`);
1562
1526
  jsonSchema.maximum = valibotAction.requirement;
1563
1527
  break;
1564
- }
1565
- case "metadata": {
1528
+ case "metadata":
1566
1529
  if (typeof valibotAction.metadata.title === "string") jsonSchema.title = valibotAction.metadata.title;
1567
1530
  if (typeof valibotAction.metadata.description === "string") jsonSchema.description = valibotAction.metadata.description;
1568
1531
  if (Array.isArray(valibotAction.metadata.examples)) jsonSchema.examples = valibotAction.metadata.examples;
1569
1532
  break;
1570
- }
1571
- case "min_entries": {
1533
+ case "min_entries":
1572
1534
  jsonSchema.minProperties = valibotAction.requirement;
1573
1535
  break;
1574
- }
1575
- case "min_length": {
1536
+ case "min_length":
1576
1537
  if (jsonSchema.type === "array") jsonSchema.minItems = valibotAction.requirement;
1577
1538
  else {
1578
1539
  if (jsonSchema.type !== "string") errors = addError(errors, `The "${valibotAction.type}" action is not supported on type "${jsonSchema.type}".`);
1579
1540
  jsonSchema.minLength = valibotAction.requirement;
1580
1541
  }
1581
1542
  break;
1582
- }
1583
- case "min_value": {
1543
+ case "min_value":
1584
1544
  if (jsonSchema.type !== "number") errors = addError(errors, `The "min_value" action is not supported on type "${jsonSchema.type}".`);
1585
1545
  jsonSchema.minimum = valibotAction.requirement;
1586
1546
  break;
1587
- }
1588
- case "multiple_of": {
1547
+ case "multiple_of":
1589
1548
  jsonSchema.multipleOf = valibotAction.requirement;
1590
1549
  break;
1591
- }
1592
- case "non_empty": {
1550
+ case "non_empty":
1593
1551
  if (jsonSchema.type === "array") jsonSchema.minItems = 1;
1594
1552
  else {
1595
1553
  if (jsonSchema.type !== "string") errors = addError(errors, `The "${valibotAction.type}" action is not supported on type "${jsonSchema.type}".`);
1596
1554
  jsonSchema.minLength = 1;
1597
1555
  }
1598
1556
  break;
1599
- }
1600
- case "regex": {
1557
+ case "regex":
1601
1558
  if (valibotAction.requirement.flags) errors = addError(errors, "RegExp flags are not supported by JSON Schema.");
1602
1559
  jsonSchema.pattern = valibotAction.requirement.source;
1603
1560
  break;
1604
- }
1605
- case "title": {
1561
+ case "title":
1606
1562
  jsonSchema.title = valibotAction.title;
1607
1563
  break;
1608
- }
1609
- case "url": {
1564
+ case "url":
1610
1565
  jsonSchema.format = "uri";
1611
1566
  break;
1612
- }
1613
- case "uuid": {
1567
+ case "uuid":
1614
1568
  jsonSchema.format = "uuid";
1615
1569
  break;
1616
- }
1617
- case "value": {
1570
+ case "value":
1618
1571
  jsonSchema.const = valibotAction.requirement;
1619
1572
  break;
1620
- }
1621
1573
  default: errors = addError(errors, `The "${valibotAction.type}" action cannot be converted to JSON Schema.`);
1622
1574
  }
1623
1575
  if (config?.overrideAction) {
@@ -1692,31 +1644,26 @@ function convertSchema(jsonSchema, valibotSchema, config, context, skipRef = fal
1692
1644
  }
1693
1645
  let errors;
1694
1646
  switch (valibotSchema.type) {
1695
- case "boolean": {
1647
+ case "boolean":
1696
1648
  jsonSchema.type = "boolean";
1697
1649
  break;
1698
- }
1699
- case "null": {
1650
+ case "null":
1700
1651
  jsonSchema.type = "null";
1701
1652
  break;
1702
- }
1703
- case "number": {
1653
+ case "number":
1704
1654
  jsonSchema.type = "number";
1705
1655
  break;
1706
- }
1707
- case "string": {
1656
+ case "string":
1708
1657
  jsonSchema.type = "string";
1709
1658
  break;
1710
- }
1711
- case "array": {
1659
+ case "array":
1712
1660
  jsonSchema.type = "array";
1713
1661
  jsonSchema.items = convertSchema({}, valibotSchema.item, config, context);
1714
1662
  break;
1715
- }
1716
1663
  case "tuple":
1717
1664
  case "tuple_with_rest":
1718
1665
  case "loose_tuple":
1719
- case "strict_tuple": {
1666
+ case "strict_tuple":
1720
1667
  jsonSchema.type = "array";
1721
1668
  jsonSchema.items = [];
1722
1669
  jsonSchema.minItems = valibotSchema.items.length;
@@ -1724,11 +1671,10 @@ function convertSchema(jsonSchema, valibotSchema, config, context, skipRef = fal
1724
1671
  if (valibotSchema.type === "tuple_with_rest") jsonSchema.additionalItems = convertSchema({}, valibotSchema.rest, config, context);
1725
1672
  else if (valibotSchema.type === "strict_tuple") jsonSchema.additionalItems = false;
1726
1673
  break;
1727
- }
1728
1674
  case "object":
1729
1675
  case "object_with_rest":
1730
1676
  case "loose_object":
1731
- case "strict_object": {
1677
+ case "strict_object":
1732
1678
  jsonSchema.type = "object";
1733
1679
  jsonSchema.properties = {};
1734
1680
  jsonSchema.required = [];
@@ -1740,52 +1686,43 @@ function convertSchema(jsonSchema, valibotSchema, config, context, skipRef = fal
1740
1686
  if (valibotSchema.type === "object_with_rest") jsonSchema.additionalProperties = convertSchema({}, valibotSchema.rest, config, context);
1741
1687
  else if (valibotSchema.type === "strict_object") jsonSchema.additionalProperties = false;
1742
1688
  break;
1743
- }
1744
- case "record": {
1689
+ case "record":
1745
1690
  if ("pipe" in valibotSchema.key) errors = addError(errors, "The \"record\" schema with a schema for the key that contains a \"pipe\" cannot be converted to JSON Schema.");
1746
1691
  if (valibotSchema.key.type !== "string") errors = addError(errors, `The "record" schema with the "${valibotSchema.key.type}" schema for the key cannot be converted to JSON Schema.`);
1747
1692
  jsonSchema.type = "object";
1748
1693
  jsonSchema.additionalProperties = convertSchema({}, valibotSchema.value, config, context);
1749
1694
  break;
1750
- }
1751
1695
  case "any":
1752
1696
  case "unknown": break;
1753
1697
  case "nullable":
1754
- case "nullish": {
1698
+ case "nullish":
1755
1699
  jsonSchema.anyOf = [convertSchema({}, valibotSchema.wrapped, config, context), { type: "null" }];
1756
1700
  if (valibotSchema.default !== void 0) jsonSchema.default = getDefault(valibotSchema);
1757
1701
  break;
1758
- }
1759
1702
  case "exact_optional":
1760
1703
  case "optional":
1761
- case "undefinedable": {
1704
+ case "undefinedable":
1762
1705
  jsonSchema = convertSchema(jsonSchema, valibotSchema.wrapped, config, context);
1763
1706
  if (valibotSchema.default !== void 0) jsonSchema.default = getDefault(valibotSchema);
1764
1707
  break;
1765
- }
1766
- case "literal": {
1708
+ case "literal":
1767
1709
  if (typeof valibotSchema.literal !== "boolean" && typeof valibotSchema.literal !== "number" && typeof valibotSchema.literal !== "string") errors = addError(errors, "The value of the \"literal\" schema is not JSON compatible.");
1768
1710
  jsonSchema.const = valibotSchema.literal;
1769
1711
  break;
1770
- }
1771
- case "enum": {
1712
+ case "enum":
1772
1713
  jsonSchema.enum = valibotSchema.options;
1773
1714
  break;
1774
- }
1775
- case "picklist": {
1715
+ case "picklist":
1776
1716
  if (valibotSchema.options.some((option) => typeof option !== "number" && typeof option !== "string")) errors = addError(errors, "An option of the \"picklist\" schema is not JSON compatible.");
1777
1717
  jsonSchema.enum = valibotSchema.options;
1778
1718
  break;
1779
- }
1780
1719
  case "union":
1781
- case "variant": {
1720
+ case "variant":
1782
1721
  jsonSchema.anyOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));
1783
1722
  break;
1784
- }
1785
- case "intersect": {
1723
+ case "intersect":
1786
1724
  jsonSchema.allOf = valibotSchema.options.map((option) => convertSchema({}, option, config, context));
1787
1725
  break;
1788
- }
1789
1726
  case "lazy": {
1790
1727
  let wrappedValibotSchema = context.getterMap.get(valibotSchema.getter);
1791
1728
  if (!wrappedValibotSchema) {
@@ -1862,7 +1799,7 @@ function toJsonSchema(schema, config) {
1862
1799
 
1863
1800
  //#endregion
1864
1801
  //#region ../../node_modules/.pnpm/ansis@4.1.0/node_modules/ansis/index.cjs
1865
- var require_ansis = require_chunk.__commonJS({ "../../node_modules/.pnpm/ansis@4.1.0/node_modules/ansis/index.cjs"(exports, module) {
1802
+ var require_ansis = /* @__PURE__ */ require_chunk.__commonJS({ "../../node_modules/.pnpm/ansis@4.1.0/node_modules/ansis/index.cjs": ((exports, module) => {
1866
1803
  let e, t, r, { defineProperty: n, setPrototypeOf: l, create: o, keys: s } = Object, i$1 = "", { round: c, max: a$1 } = Math, p = (e$1) => {
1867
1804
  let t$1 = /([a-f\d]{3,6})/i.exec(e$1)?.[1], r$1 = t$1?.length, n$1 = parseInt(6 ^ r$1 ? 3 ^ r$1 ? "0" : t$1[0] + t$1[0] + t$1[1] + t$1[1] + t$1[2] + t$1[2] : t$1, 16);
1868
1805
  return [
@@ -1963,11 +1900,11 @@ var require_ansis = require_chunk.__commonJS({ "../../node_modules/.pnpm/ansis@4
1963
1900
  })), t$1.extend(M);
1964
1901
  }, y = new w();
1965
1902
  module.exports = y, y.default = y;
1966
- } });
1903
+ }) });
1967
1904
 
1968
1905
  //#endregion
1969
1906
  //#region ../../node_modules/.pnpm/ansis@4.1.0/node_modules/ansis/index.mjs
1970
- var import_ansis = require_chunk.__toESM(require_ansis(), 1);
1907
+ var import_ansis = /* @__PURE__ */ require_chunk.__toESM(require_ansis(), 1);
1971
1908
  var ansis_default = import_ansis.default;
1972
1909
  const { Ansis, fg, bg, rgb, bgRgb, hex, bgHex, reset, inverse, hidden, visible, bold, dim, italic, underline, strikethrough, black, red, green, yellow, blue, magenta, cyan, white, gray, redBright, greenBright, yellowBright, blueBright, magentaBright, cyanBright, whiteBright, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bgGray, bgRedBright, bgGreenBright, bgYellowBright, bgBlueBright, bgMagentaBright, bgCyanBright, bgWhiteBright } = import_ansis.default;
1973
1910
 
@@ -2091,6 +2028,7 @@ const ChecksOptionsSchema = strictObject({
2091
2028
  filenameConflict: pipe(optional(boolean()), description("Whether to emit warning when detecting filename conflict")),
2092
2029
  commonJsVariableInEsm: pipe(optional(boolean()), description("Whether to emit warning when detecting common js variable in esm")),
2093
2030
  importIsUndefined: pipe(optional(boolean()), description("Whether to emit warning when detecting import is undefined")),
2031
+ emptyImportMeta: pipe(optional(boolean()), description("Whether to emit warning when detecting empty import meta")),
2094
2032
  configurationFieldConflict: pipe(optional(boolean()), description("Whether to emit warning when detecting configuration field conflict"))
2095
2033
  });
2096
2034
  const MinifyOptionsSchema = strictObject({
@@ -2118,7 +2056,10 @@ const TreeshakingOptionsSchema = union([boolean(), looseObject({
2118
2056
  unknownGlobalSideEffects: optional(boolean()),
2119
2057
  commonjs: optional(boolean())
2120
2058
  })]);
2121
- const OptimizationOptionsSchema = strictObject({ inlineConst: pipe(optional(boolean()), description("Enable crossmodule constant inlining")) });
2059
+ const OptimizationOptionsSchema = strictObject({
2060
+ inlineConst: pipe(optional(boolean()), description("Enable crossmodule constant inlining")),
2061
+ pifeForModuleWrappers: pipe(optional(boolean()), description("Use PIFE pattern for module wrappers"))
2062
+ });
2122
2063
  const OnLogSchema = pipe(function_(), args(tuple([
2123
2064
  LogLevelSchema,
2124
2065
  RollupLogSchema,
@@ -2273,6 +2214,7 @@ const OutputOptionsSchema = strictObject({
2273
2214
  literal("inline"),
2274
2215
  literal("hidden")
2275
2216
  ])), description(`Generate sourcemap (\`-s inline\` for inline, or ${ansis_default.bold("pass the `-s` on the last argument if you want to generate `.map` file")})`)),
2217
+ sourcemapBaseUrl: pipe(optional(string()), description("Base URL used to prefix sourcemap paths")),
2276
2218
  sourcemapDebugIds: pipe(optional(boolean()), description("Inject sourcemap debug IDs")),
2277
2219
  sourcemapIgnoreList: optional(union([boolean(), custom(() => true)])),
2278
2220
  sourcemapPathTransform: optional(custom(() => true)),
@@ -2590,44 +2532,38 @@ function bindingifyFilterExprImpl(expr, list) {
2590
2532
  });
2591
2533
  break;
2592
2534
  }
2593
- case "not": {
2535
+ case "not":
2594
2536
  bindingifyFilterExprImpl(expr.expr, list);
2595
2537
  list.push({ kind: "Not" });
2596
2538
  break;
2597
- }
2598
- case "id": {
2539
+ case "id":
2599
2540
  list.push({
2600
2541
  kind: "Id",
2601
2542
  payload: expr.pattern
2602
2543
  });
2603
2544
  if (expr.params.cleanUrl) list.push({ kind: "CleanUrl" });
2604
2545
  break;
2605
- }
2606
- case "moduleType": {
2546
+ case "moduleType":
2607
2547
  list.push({
2608
2548
  kind: "ModuleType",
2609
2549
  payload: expr.pattern
2610
2550
  });
2611
2551
  break;
2612
- }
2613
- case "code": {
2552
+ case "code":
2614
2553
  list.push({
2615
2554
  kind: "Code",
2616
2555
  payload: expr.pattern
2617
2556
  });
2618
2557
  break;
2619
- }
2620
- case "include": {
2558
+ case "include":
2621
2559
  bindingifyFilterExprImpl(expr.expr, list);
2622
2560
  list.push({ kind: "Include" });
2623
2561
  break;
2624
- }
2625
- case "exclude": {
2562
+ case "exclude":
2626
2563
  bindingifyFilterExprImpl(expr.expr, list);
2627
2564
  list.push({ kind: "Exclude" });
2628
2565
  break;
2629
- }
2630
- case "query": {
2566
+ case "query":
2631
2567
  list.push({
2632
2568
  kind: "QueryKey",
2633
2569
  payload: expr.key
@@ -2637,7 +2573,6 @@ function bindingifyFilterExprImpl(expr, list) {
2637
2573
  payload: expr.pattern
2638
2574
  });
2639
2575
  break;
2640
- }
2641
2576
  default: throw new Error(`Unknown filter expression: ${expr}`);
2642
2577
  }
2643
2578
  }
@@ -2688,9 +2623,28 @@ function bindingAssetSource(source) {
2688
2623
  return { inner: source };
2689
2624
  }
2690
2625
 
2626
+ //#endregion
2627
+ //#region src/plugin/fs.ts
2628
+ const fsModule = {
2629
+ appendFile: node_fs_promises.default.appendFile,
2630
+ copyFile: node_fs_promises.default.copyFile,
2631
+ mkdir: node_fs_promises.default.mkdir,
2632
+ mkdtemp: node_fs_promises.default.mkdtemp,
2633
+ readdir: node_fs_promises.default.readdir,
2634
+ readFile: node_fs_promises.default.readFile,
2635
+ realpath: node_fs_promises.default.realpath,
2636
+ rename: node_fs_promises.default.rename,
2637
+ rmdir: node_fs_promises.default.rmdir,
2638
+ stat: node_fs_promises.default.stat,
2639
+ lstat: node_fs_promises.default.lstat,
2640
+ unlink: node_fs_promises.default.unlink,
2641
+ writeFile: node_fs_promises.default.writeFile
2642
+ };
2643
+
2691
2644
  //#endregion
2692
2645
  //#region src/plugin/plugin-context.ts
2693
2646
  var PluginContextImpl = class extends MinimalPluginContextImpl {
2647
+ fs = fsModule;
2694
2648
  getModuleInfo;
2695
2649
  constructor(outputOptions, context, plugin, data, onLog, logLevel, watchMode, currentLoadingModule) {
2696
2650
  super(onLog, logLevel, plugin.name, watchMode);
@@ -3608,7 +3562,7 @@ var ChunkingContextImpl = class {
3608
3562
  //#endregion
3609
3563
  //#region src/utils/bindingify-output-options.ts
3610
3564
  function bindingifyOutputOptions(outputOptions) {
3611
- const { dir, format, exports: exports$1, hashCharacters, sourcemap, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot, manualChunks, topLevelVar } = outputOptions;
3565
+ const { dir, format, exports: exports$1, hashCharacters, sourcemap, sourcemapBaseUrl, sourcemapDebugIds, sourcemapIgnoreList, sourcemapPathTransform, name, assetFileNames, entryFileNames, chunkFileNames, cssEntryFileNames, cssChunkFileNames, banner, footer, intro, outro, esModule, globals, file, sanitizeFileName, preserveModules, virtualDirname, legalComments, preserveModulesRoot, manualChunks, topLevelVar } = outputOptions;
3612
3566
  const advancedChunks = bindingifyAdvancedChunks(outputOptions.advancedChunks, manualChunks);
3613
3567
  return {
3614
3568
  dir,
@@ -3617,6 +3571,7 @@ function bindingifyOutputOptions(outputOptions) {
3617
3571
  exports: exports$1,
3618
3572
  hashCharacters,
3619
3573
  sourcemap: bindingifySourcemap(sourcemap),
3574
+ sourcemapBaseUrl,
3620
3575
  sourcemapDebugIds,
3621
3576
  sourcemapIgnoreList: bindingifySourcemapIgnoreList(sourcemapIgnoreList),
3622
3577
  sourcemapPathTransform,
@@ -4351,8 +4306,12 @@ var RolldownBuild = class {
4351
4306
  await this.close();
4352
4307
  }
4353
4308
  async generateHmrPatch(changedFiles) {
4354
- const output = await this.#bundlerImpl.impl.generateHmrPatch(changedFiles);
4355
- return transformHmrPatchOutput(output);
4309
+ const ret = await this.#bundlerImpl.impl.generateHmrPatch(changedFiles);
4310
+ switch (ret.type) {
4311
+ case "Ok": return ret.field0;
4312
+ case "Error": throw normalizeErrors(ret.field0);
4313
+ default: throw new Error("Unknown error");
4314
+ }
4356
4315
  }
4357
4316
  async hmrInvalidate(file, firstInvalidatedBy) {
4358
4317
  const output = await this.#bundlerImpl.impl.hmrInvalidate(file, firstInvalidatedBy);
@@ -4662,12 +4621,6 @@ Object.defineProperty(exports, 'manifestPlugin', {
4662
4621
  return manifestPlugin;
4663
4622
  }
4664
4623
  });
4665
- Object.defineProperty(exports, 'moduleFederationPlugin', {
4666
- enumerable: true,
4667
- get: function () {
4668
- return moduleFederationPlugin;
4669
- }
4670
- });
4671
4624
  Object.defineProperty(exports, 'modulePreloadPolyfillPlugin', {
4672
4625
  enumerable: true,
4673
4626
  get: function () {