@rollup/wasm-node 4.34.9 → 4.36.0

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
  /*
2
2
  @license
3
- Rollup.js v4.34.9
4
- Sat, 01 Mar 2025 07:32:06 GMT - commit 0ab9b9772e24dfe9ef08bfce3132e99a15b793f6
3
+ Rollup.js v4.36.0
4
+ Mon, 17 Mar 2025 08:35:11 GMT - commit ab7bfa8fe9c25e41cc62058fa2dcde6b321fd51d
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.34.9
4
- Sat, 01 Mar 2025 07:32:06 GMT - commit 0ab9b9772e24dfe9ef08bfce3132e99a15b793f6
3
+ Rollup.js v4.36.0
4
+ Mon, 17 Mar 2025 08:35:11 GMT - commit ab7bfa8fe9c25e41cc62058fa2dcde6b321fd51d
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.34.9
4
- Sat, 01 Mar 2025 07:32:06 GMT - commit 0ab9b9772e24dfe9ef08bfce3132e99a15b793f6
3
+ Rollup.js v4.36.0
4
+ Mon, 17 Mar 2025 08:35:11 GMT - commit ab7bfa8fe9c25e41cc62058fa2dcde6b321fd51d
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.34.9
4
- Sat, 01 Mar 2025 07:32:06 GMT - commit 0ab9b9772e24dfe9ef08bfce3132e99a15b793f6
3
+ Rollup.js v4.36.0
4
+ Mon, 17 Mar 2025 08:35:11 GMT - commit ab7bfa8fe9c25e41cc62058fa2dcde6b321fd51d
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.34.9
4
- Sat, 01 Mar 2025 07:32:06 GMT - commit 0ab9b9772e24dfe9ef08bfce3132e99a15b793f6
3
+ Rollup.js v4.36.0
4
+ Mon, 17 Mar 2025 08:35:11 GMT - commit ab7bfa8fe9c25e41cc62058fa2dcde6b321fd51d
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -17,7 +17,7 @@ const native_js = require('../native.js');
17
17
  const node_perf_hooks = require('node:perf_hooks');
18
18
  const promises = require('node:fs/promises');
19
19
 
20
- var version = "4.34.9";
20
+ var version = "4.36.0";
21
21
 
22
22
  function ensureArray$1(items) {
23
23
  if (Array.isArray(items)) {
@@ -1386,7 +1386,7 @@ function getDefaultExportFromCjs (x) {
1386
1386
  }
1387
1387
 
1388
1388
  function getAugmentedNamespace(n) {
1389
- if (n.__esModule) return n;
1389
+ if (Object.prototype.hasOwnProperty.call(n, '__esModule')) return n;
1390
1390
  var f = n.default;
1391
1391
  if (typeof f == "function") {
1392
1392
  var a = function a () {
@@ -9794,58 +9794,114 @@ function updateExtensionForRelativeAmdId(id, forceJsExtensionForImports) {
9794
9794
  }
9795
9795
 
9796
9796
  const builtinModules = [
9797
+ "node:assert",
9797
9798
  "assert",
9799
+ "node:assert/strict",
9798
9800
  "assert/strict",
9801
+ "node:async_hooks",
9799
9802
  "async_hooks",
9803
+ "node:buffer",
9800
9804
  "buffer",
9805
+ "node:child_process",
9801
9806
  "child_process",
9807
+ "node:cluster",
9802
9808
  "cluster",
9809
+ "node:console",
9803
9810
  "console",
9811
+ "node:constants",
9804
9812
  "constants",
9813
+ "node:crypto",
9805
9814
  "crypto",
9815
+ "node:dgram",
9806
9816
  "dgram",
9817
+ "node:diagnostics_channel",
9807
9818
  "diagnostics_channel",
9819
+ "node:dns",
9808
9820
  "dns",
9821
+ "node:dns/promises",
9809
9822
  "dns/promises",
9823
+ "node:domain",
9810
9824
  "domain",
9825
+ "node:events",
9811
9826
  "events",
9827
+ "node:fs",
9812
9828
  "fs",
9829
+ "node:fs/promises",
9813
9830
  "fs/promises",
9831
+ "node:http",
9814
9832
  "http",
9833
+ "node:http2",
9815
9834
  "http2",
9835
+ "node:https",
9816
9836
  "https",
9837
+ "node:inspector",
9817
9838
  "inspector",
9839
+ "node:inspector/promises",
9818
9840
  "inspector/promises",
9841
+ "node:module",
9819
9842
  "module",
9843
+ "node:net",
9820
9844
  "net",
9845
+ "node:os",
9821
9846
  "os",
9847
+ "node:path",
9822
9848
  "path",
9849
+ "node:path/posix",
9823
9850
  "path/posix",
9851
+ "node:path/win32",
9824
9852
  "path/win32",
9853
+ "node:perf_hooks",
9825
9854
  "perf_hooks",
9855
+ "node:process",
9826
9856
  "process",
9827
- "punycode",
9857
+ "node:querystring",
9828
9858
  "querystring",
9859
+ "node:quic",
9860
+ "node:readline",
9829
9861
  "readline",
9862
+ "node:readline/promises",
9830
9863
  "readline/promises",
9864
+ "node:repl",
9831
9865
  "repl",
9866
+ "node:sea",
9867
+ "node:sqlite",
9868
+ "node:stream",
9832
9869
  "stream",
9870
+ "node:stream/consumers",
9833
9871
  "stream/consumers",
9872
+ "node:stream/promises",
9834
9873
  "stream/promises",
9874
+ "node:stream/web",
9835
9875
  "stream/web",
9876
+ "node:string_decoder",
9836
9877
  "string_decoder",
9878
+ "node:test",
9879
+ "node:test/reporters",
9880
+ "node:timers",
9837
9881
  "timers",
9882
+ "node:timers/promises",
9838
9883
  "timers/promises",
9884
+ "node:tls",
9839
9885
  "tls",
9886
+ "node:trace_events",
9840
9887
  "trace_events",
9888
+ "node:tty",
9841
9889
  "tty",
9890
+ "node:url",
9842
9891
  "url",
9892
+ "node:util",
9843
9893
  "util",
9894
+ "node:util/types",
9844
9895
  "util/types",
9896
+ "node:v8",
9845
9897
  "v8",
9898
+ "node:vm",
9846
9899
  "vm",
9900
+ "node:wasi",
9847
9901
  "wasi",
9902
+ "node:worker_threads",
9848
9903
  "worker_threads",
9904
+ "node:zlib",
9849
9905
  "zlib"
9850
9906
  ];
9851
9907
 
@@ -13069,6 +13125,12 @@ class AssignmentPattern extends NodeBase {
13069
13125
  }
13070
13126
 
13071
13127
  class AwaitExpression extends NodeBase {
13128
+ get isTopLevelAwait() {
13129
+ return isFlagSet(this.flags, 134217728 /* Flag.isTopLevelAwait */);
13130
+ }
13131
+ set isTopLevelAwait(value) {
13132
+ this.flags = setFlag(this.flags, 134217728 /* Flag.isTopLevelAwait */, value);
13133
+ }
13072
13134
  hasEffects() {
13073
13135
  if (!this.deoptimized)
13074
13136
  this.applyDeoptimizations();
@@ -13083,13 +13145,14 @@ class AwaitExpression extends NodeBase {
13083
13145
  this.included = true;
13084
13146
  if (!this.deoptimized)
13085
13147
  this.applyDeoptimizations();
13086
- checkTopLevelAwait: if (!this.scope.context.usesTopLevelAwait) {
13148
+ checkTopLevelAwait: {
13087
13149
  let parent = this.parent;
13088
13150
  do {
13089
13151
  if (parent instanceof FunctionNode || parent instanceof ArrowFunctionExpression)
13090
13152
  break checkTopLevelAwait;
13091
13153
  } while ((parent = parent.parent));
13092
13154
  this.scope.context.usesTopLevelAwait = true;
13155
+ this.isTopLevelAwait = true;
13093
13156
  }
13094
13157
  // Thenables need to be included
13095
13158
  this.argument.includePath(THEN_PATH, context);
@@ -14299,6 +14362,9 @@ class VariableDeclarator extends NodeBase {
14299
14362
  }
14300
14363
  VariableDeclarator.prototype.applyDeoptimizations = doNotDeoptimize;
14301
14364
 
14365
+ function getChunkInfoWithPath(chunk) {
14366
+ return { fileName: chunk.getFileName(), ...chunk.getPreRenderedChunkInfo() };
14367
+ }
14302
14368
  class ImportExpression extends NodeBase {
14303
14369
  constructor() {
14304
14370
  super(...arguments);
@@ -14315,6 +14381,9 @@ class ImportExpression extends NodeBase {
14315
14381
  bind() {
14316
14382
  this.source.bind();
14317
14383
  }
14384
+ get isFollowingTopLevelAwait() {
14385
+ return this.parent instanceof AwaitExpression && this.parent.isTopLevelAwait;
14386
+ }
14318
14387
  /**
14319
14388
  * Get imported variables for deterministic usage, valid cases are:
14320
14389
  *
@@ -14467,7 +14536,7 @@ class ImportExpression extends NodeBase {
14467
14536
  }
14468
14537
  }
14469
14538
  }
14470
- setExternalResolution(exportMode, resolution, options, snippets, pluginDriver, accessedGlobalsByScope, resolutionString, namespaceExportName, attributes) {
14539
+ setExternalResolution(exportMode, resolution, options, snippets, pluginDriver, accessedGlobalsByScope, resolutionString, namespaceExportName, attributes, ownChunk, targetChunk) {
14471
14540
  const { format } = options;
14472
14541
  this.inlineNamespace = null;
14473
14542
  this.resolution = resolution;
@@ -14476,7 +14545,7 @@ class ImportExpression extends NodeBase {
14476
14545
  this.attributes = attributes;
14477
14546
  const accessedGlobals = [...(accessedImportGlobals[format] || [])];
14478
14547
  let helper;
14479
- ({ helper, mechanism: this.mechanism } = this.getDynamicImportMechanismAndHelper(resolution, exportMode, options, snippets, pluginDriver));
14548
+ ({ helper, mechanism: this.mechanism } = this.getDynamicImportMechanismAndHelper(resolution, exportMode, options, snippets, pluginDriver, ownChunk, targetChunk));
14480
14549
  if (helper) {
14481
14550
  accessedGlobals.push(helper);
14482
14551
  }
@@ -14487,12 +14556,39 @@ class ImportExpression extends NodeBase {
14487
14556
  setInternalResolution(inlineNamespace) {
14488
14557
  this.inlineNamespace = inlineNamespace;
14489
14558
  }
14490
- getDynamicImportMechanismAndHelper(resolution, exportMode, { compact, dynamicImportInCjs, format, generatedCode: { arrowFunctions }, interop }, { _, getDirectReturnFunction, getDirectReturnIifeLeft }, pluginDriver) {
14559
+ getDynamicImportMechanismAndHelper(resolution, exportMode, { compact, dynamicImportInCjs, format, generatedCode: { arrowFunctions }, interop }, { _, getDirectReturnFunction, getDirectReturnIifeLeft }, pluginDriver, ownChunk, targetChunk) {
14491
14560
  const mechanism = pluginDriver.hookFirstSync('renderDynamicImport', [
14492
14561
  {
14562
+ chunk: getChunkInfoWithPath(ownChunk),
14493
14563
  customResolution: typeof this.resolution === 'string' ? this.resolution : null,
14494
14564
  format,
14565
+ getTargetChunkImports() {
14566
+ if (targetChunk === null)
14567
+ return null;
14568
+ const chunkInfos = [];
14569
+ const importerPath = ownChunk.getFileName();
14570
+ for (const dep of targetChunk.dependencies) {
14571
+ const resolvedImportPath = `'${dep.getImportPath(importerPath)}'`;
14572
+ if (dep instanceof ExternalChunk) {
14573
+ chunkInfos.push({
14574
+ fileName: dep.getFileName(),
14575
+ resolvedImportPath,
14576
+ type: 'external'
14577
+ });
14578
+ }
14579
+ else {
14580
+ chunkInfos.push({
14581
+ chunk: dep.getPreRenderedChunkInfo(),
14582
+ fileName: dep.getFileName(),
14583
+ resolvedImportPath,
14584
+ type: 'internal'
14585
+ });
14586
+ }
14587
+ }
14588
+ return chunkInfos;
14589
+ },
14495
14590
  moduleId: this.scope.context.module.id,
14591
+ targetChunk: targetChunk ? getChunkInfoWithPath(targetChunk) : null,
14496
14592
  targetModuleId: this.resolution && typeof this.resolution !== 'string' ? this.resolution.id : null
14497
14593
  }
14498
14594
  ]);
@@ -17935,6 +18031,7 @@ class Module {
17935
18031
  this.importedFromNotTreeshaken = false;
17936
18032
  this.importers = [];
17937
18033
  this.includedDynamicImporters = [];
18034
+ this.includedDirectTopLevelAwaitingDynamicImporters = new Set();
17938
18035
  this.includedImports = new Set();
17939
18036
  this.isExecuted = false;
17940
18037
  this.isUserDefinedEntryPoint = false;
@@ -18791,6 +18888,9 @@ class Module {
18791
18888
  if (resolution instanceof Module) {
18792
18889
  if (!resolution.includedDynamicImporters.includes(this)) {
18793
18890
  resolution.includedDynamicImporters.push(this);
18891
+ if (node.isFollowingTopLevelAwait) {
18892
+ resolution.includedDirectTopLevelAwaitingDynamicImporters.add(this);
18893
+ }
18794
18894
  }
18795
18895
  const importedNames = this.options.treeshake
18796
18896
  ? node.getDeterministicImportedNames()
@@ -19175,13 +19275,13 @@ class Chunk {
19175
19275
  this.bundle = bundle;
19176
19276
  this.inputBase = inputBase;
19177
19277
  this.snippets = snippets;
19278
+ this.dependencies = new Set();
19178
19279
  this.entryModules = [];
19179
19280
  this.exportMode = 'named';
19180
19281
  this.facadeModule = null;
19181
19282
  this.namespaceVariableName = '';
19182
19283
  this.variableName = '';
19183
19284
  this.accessedGlobalsByScope = new Map();
19184
- this.dependencies = new Set();
19185
19285
  this.dynamicEntryModules = [];
19186
19286
  this.dynamicName = null;
19187
19287
  this.exportNamesByVariable = new Map();
@@ -19486,9 +19586,9 @@ class Chunk {
19486
19586
  this.setUpChunkImportsAndExportsForModule(module);
19487
19587
  }
19488
19588
  }
19489
- async render() {
19490
- const { dependencies, exportMode, facadeModule, inputOptions: { onLog }, outputOptions, pluginDriver, snippets } = this;
19491
- const { format, hoistTransitiveImports, preserveModules } = outputOptions;
19589
+ inlineTransitiveImports() {
19590
+ const { facadeModule, dependencies, outputOptions } = this;
19591
+ const { hoistTransitiveImports, preserveModules } = outputOptions;
19492
19592
  // for static and dynamic entry points, add transitive dependencies to this
19493
19593
  // chunk's dependencies to avoid loading latency
19494
19594
  if (hoistTransitiveImports && !preserveModules && facadeModule !== null) {
@@ -19497,6 +19597,10 @@ class Chunk {
19497
19597
  this.inlineChunkDependencies(dep);
19498
19598
  }
19499
19599
  }
19600
+ }
19601
+ async render() {
19602
+ const { exportMode, facadeModule, inputOptions: { onLog }, outputOptions, pluginDriver, snippets } = this;
19603
+ const { format, preserveModules } = outputOptions;
19500
19604
  const preliminaryFileName = this.getPreliminaryFileName();
19501
19605
  const preliminarySourcemapFileName = this.getPreliminarySourcemapFileName();
19502
19606
  const { accessedGlobals, indent, magicString, renderedSource, usedModules, usesTopLevelAwait } = this.renderModules(preliminaryFileName.fileName);
@@ -20079,13 +20183,13 @@ class Chunk {
20079
20183
  node.setInternalResolution(resolution.namespace);
20080
20184
  }
20081
20185
  else {
20082
- node.setExternalResolution((facadeChunk || chunk).exportMode, resolution, outputOptions, snippets, pluginDriver, accessedGlobalsByScope, `'${(facadeChunk || chunk).getImportPath(fileName)}'`, !facadeChunk?.strictFacade && chunk.exportNamesByVariable.get(resolution.namespace)[0], null);
20186
+ node.setExternalResolution((facadeChunk || chunk).exportMode, resolution, outputOptions, snippets, pluginDriver, accessedGlobalsByScope, `'${(facadeChunk || chunk).getImportPath(fileName)}'`, !facadeChunk?.strictFacade && chunk.exportNamesByVariable.get(resolution.namespace)[0], null, this, facadeChunk || chunk);
20083
20187
  }
20084
20188
  }
20085
20189
  else {
20086
20190
  const { node, resolution } = resolvedDynamicImport;
20087
20191
  const [resolutionString, attributes] = this.getDynamicImportStringAndAttributes(resolution, fileName, node);
20088
- node.setExternalResolution('external', resolution, outputOptions, snippets, pluginDriver, accessedGlobalsByScope, resolutionString, false, attributes);
20192
+ node.setExternalResolution('external', resolution, outputOptions, snippets, pluginDriver, accessedGlobalsByScope, resolutionString, false, attributes, this, null);
20089
20193
  }
20090
20194
  }
20091
20195
  }
@@ -20351,15 +20455,16 @@ function* concatLazy(iterables) {
20351
20455
  */
20352
20456
  function getChunkAssignments(entries, manualChunkAliasByEntry, minChunkSize, log) {
20353
20457
  const { chunkDefinitions, modulesInManualChunks } = getChunkDefinitionsFromManualChunks(manualChunkAliasByEntry);
20354
- const { allEntries, dependentEntriesByModule, dynamicallyDependentEntriesByDynamicEntry, dynamicImportsByEntry } = analyzeModuleGraph(entries);
20458
+ const { allEntries, dependentEntriesByModule, dynamicallyDependentEntriesByDynamicEntry, dynamicImportsByEntry, dynamicallyDependentEntriesByAwaitedDynamicEntry, awaitedDynamicImportsByEntry } = analyzeModuleGraph(entries);
20355
20459
  // Each chunk is identified by its position in this array
20356
20460
  const chunkAtoms = getChunksWithSameDependentEntries(getModulesWithDependentEntries(dependentEntriesByModule, modulesInManualChunks));
20357
20461
  const staticDependencyAtomsByEntry = getStaticDependencyAtomsByEntry(allEntries, chunkAtoms);
20358
20462
  // Warning: This will consume dynamicallyDependentEntriesByDynamicEntry.
20359
20463
  // If we no longer want this, we should make a copy here.
20360
20464
  const alreadyLoadedAtomsByEntry = getAlreadyLoadedAtomsByEntry(staticDependencyAtomsByEntry, dynamicallyDependentEntriesByDynamicEntry, dynamicImportsByEntry, allEntries);
20465
+ const awaitedAlreadyLoadedAtomsByEntry = getAlreadyLoadedAtomsByEntry(staticDependencyAtomsByEntry, dynamicallyDependentEntriesByAwaitedDynamicEntry, awaitedDynamicImportsByEntry, allEntries);
20361
20466
  // This mutates the dependentEntries in chunkAtoms
20362
- removeUnnecessaryDependentEntries(chunkAtoms, alreadyLoadedAtomsByEntry);
20467
+ removeUnnecessaryDependentEntries(chunkAtoms, alreadyLoadedAtomsByEntry, awaitedAlreadyLoadedAtomsByEntry);
20363
20468
  const { chunks, sideEffectAtoms, sizeByAtom } = getChunksWithSameDependentEntriesAndCorrelatedAtoms(chunkAtoms, staticDependencyAtomsByEntry, alreadyLoadedAtomsByEntry, minChunkSize);
20364
20469
  chunkDefinitions.push(...getOptimizedChunks(chunks, minChunkSize, sideEffectAtoms, sizeByAtom, log).map(({ modules }) => ({
20365
20470
  alias: null,
@@ -20395,13 +20500,17 @@ function addStaticDependenciesToManualChunk(entry, manualChunkModules, modulesIn
20395
20500
  }
20396
20501
  function analyzeModuleGraph(entries) {
20397
20502
  const dynamicEntryModules = new Set();
20503
+ const awaitedDynamicEntryModules = new Set();
20398
20504
  const dependentEntriesByModule = new Map();
20399
20505
  const allEntriesSet = new Set(entries);
20400
20506
  const dynamicImportModulesByEntry = new Array(allEntriesSet.size);
20507
+ const awaitedDynamicImportModulesByEntry = new Array(allEntriesSet.size);
20401
20508
  let entryIndex = 0;
20402
20509
  for (const currentEntry of allEntriesSet) {
20403
20510
  const dynamicImportsForCurrentEntry = new Set();
20511
+ const awaitedDynamicImportsForCurrentEntry = new Set();
20404
20512
  dynamicImportModulesByEntry[entryIndex] = dynamicImportsForCurrentEntry;
20513
+ awaitedDynamicImportModulesByEntry[entryIndex] = awaitedDynamicImportsForCurrentEntry;
20405
20514
  const modulesToHandle = new Set([currentEntry]);
20406
20515
  for (const module of modulesToHandle) {
20407
20516
  getOrCreate(dependentEntriesByModule, module, (getNewSet)).add(entryIndex);
@@ -20417,6 +20526,10 @@ function analyzeModuleGraph(entries) {
20417
20526
  dynamicEntryModules.add(resolution);
20418
20527
  allEntriesSet.add(resolution);
20419
20528
  dynamicImportsForCurrentEntry.add(resolution);
20529
+ if (resolution.includedDirectTopLevelAwaitingDynamicImporters.has(currentEntry)) {
20530
+ awaitedDynamicEntryModules.add(resolution);
20531
+ awaitedDynamicImportsForCurrentEntry.add(resolution);
20532
+ }
20420
20533
  }
20421
20534
  }
20422
20535
  for (const dependency of module.implicitlyLoadedBefore) {
@@ -20429,23 +20542,39 @@ function analyzeModuleGraph(entries) {
20429
20542
  entryIndex++;
20430
20543
  }
20431
20544
  const allEntries = [...allEntriesSet];
20432
- const { dynamicEntries, dynamicImportsByEntry } = getDynamicEntries(allEntries, dynamicEntryModules, dynamicImportModulesByEntry);
20545
+ const { awaitedDynamicEntries, awaitedDynamicImportsByEntry, dynamicEntries, dynamicImportsByEntry } = getDynamicEntries(allEntries, dynamicEntryModules, dynamicImportModulesByEntry, awaitedDynamicEntryModules, awaitedDynamicImportModulesByEntry);
20433
20546
  return {
20434
20547
  allEntries,
20548
+ awaitedDynamicImportsByEntry,
20435
20549
  dependentEntriesByModule,
20436
- dynamicallyDependentEntriesByDynamicEntry: getDynamicallyDependentEntriesByDynamicEntry(dependentEntriesByModule, dynamicEntries, allEntries),
20550
+ dynamicallyDependentEntriesByAwaitedDynamicEntry: getDynamicallyDependentEntriesByDynamicEntry(dependentEntriesByModule, awaitedDynamicEntries, allEntries, dynamicEntry => dynamicEntry.includedDirectTopLevelAwaitingDynamicImporters),
20551
+ dynamicallyDependentEntriesByDynamicEntry: getDynamicallyDependentEntriesByDynamicEntry(dependentEntriesByModule, dynamicEntries, allEntries, dynamicEntry => dynamicEntry.includedDynamicImporters),
20437
20552
  dynamicImportsByEntry
20438
20553
  };
20439
20554
  }
20440
- function getDynamicEntries(allEntries, dynamicEntryModules, dynamicImportModulesByEntry) {
20555
+ function getDynamicEntries(allEntries, dynamicEntryModules, dynamicImportModulesByEntry, awaitedDynamicEntryModules, awaitedDynamicImportModulesByEntry) {
20441
20556
  const entryIndexByModule = new Map();
20442
20557
  const dynamicEntries = new Set();
20558
+ const awaitedDynamicEntries = new Set();
20443
20559
  for (const [entryIndex, entry] of allEntries.entries()) {
20444
20560
  entryIndexByModule.set(entry, entryIndex);
20445
20561
  if (dynamicEntryModules.has(entry)) {
20446
20562
  dynamicEntries.add(entryIndex);
20447
20563
  }
20564
+ if (awaitedDynamicEntryModules.has(entry)) {
20565
+ awaitedDynamicEntries.add(entryIndex);
20566
+ }
20448
20567
  }
20568
+ const dynamicImportsByEntry = getDynamicImportsByEntry(dynamicImportModulesByEntry, entryIndexByModule);
20569
+ const awaitedDynamicImportsByEntry = getDynamicImportsByEntry(awaitedDynamicImportModulesByEntry, entryIndexByModule);
20570
+ return {
20571
+ awaitedDynamicEntries,
20572
+ awaitedDynamicImportsByEntry,
20573
+ dynamicEntries,
20574
+ dynamicImportsByEntry
20575
+ };
20576
+ }
20577
+ function getDynamicImportsByEntry(dynamicImportModulesByEntry, entryIndexByModule) {
20449
20578
  const dynamicImportsByEntry = new Array(dynamicImportModulesByEntry.length);
20450
20579
  let index = 0;
20451
20580
  for (const dynamicImportModules of dynamicImportModulesByEntry) {
@@ -20455,15 +20584,15 @@ function getDynamicEntries(allEntries, dynamicEntryModules, dynamicImportModules
20455
20584
  }
20456
20585
  dynamicImportsByEntry[index++] = dynamicImports;
20457
20586
  }
20458
- return { dynamicEntries, dynamicImportsByEntry };
20587
+ return dynamicImportsByEntry;
20459
20588
  }
20460
- function getDynamicallyDependentEntriesByDynamicEntry(dependentEntriesByModule, dynamicEntries, allEntries) {
20589
+ function getDynamicallyDependentEntriesByDynamicEntry(dependentEntriesByModule, dynamicEntries, allEntries, getDynamicImporters) {
20461
20590
  const dynamicallyDependentEntriesByDynamicEntry = new Map();
20462
20591
  for (const dynamicEntryIndex of dynamicEntries) {
20463
20592
  const dynamicallyDependentEntries = getOrCreate(dynamicallyDependentEntriesByDynamicEntry, dynamicEntryIndex, (getNewSet));
20464
20593
  const dynamicEntry = allEntries[dynamicEntryIndex];
20465
20594
  for (const importer of concatLazy([
20466
- dynamicEntry.includedDynamicImporters,
20595
+ getDynamicImporters(dynamicEntry),
20467
20596
  dynamicEntry.implicitlyLoadedAfter
20468
20597
  ])) {
20469
20598
  for (const entry of dependentEntriesByModule.get(importer)) {
@@ -20542,13 +20671,15 @@ function getAlreadyLoadedAtomsByEntry(staticDependencyAtomsByEntry, dynamicallyD
20542
20671
  * This removes all unnecessary dynamic entries from the dependentEntries in its
20543
20672
  * first argument if a chunk is already loaded without that entry.
20544
20673
  */
20545
- function removeUnnecessaryDependentEntries(chunkAtoms, alreadyLoadedAtomsByEntry) {
20674
+ function removeUnnecessaryDependentEntries(chunkAtoms, alreadyLoadedAtomsByEntry, awaitedAlreadyLoadedAtomsByEntry) {
20546
20675
  // Remove entries from dependent entries if a chunk is already loaded without
20547
- // that entry.
20676
+ // that entry. Do not remove already loaded atoms where all dynamic imports
20677
+ // are awaited to avoid cycles in the output.
20548
20678
  let chunkMask = 1n;
20549
20679
  for (const { dependentEntries } of chunkAtoms) {
20550
20680
  for (const entryIndex of dependentEntries) {
20551
- if ((alreadyLoadedAtomsByEntry[entryIndex] & chunkMask) === chunkMask) {
20681
+ if ((alreadyLoadedAtomsByEntry[entryIndex] & chunkMask) === chunkMask &&
20682
+ (awaitedAlreadyLoadedAtomsByEntry[entryIndex] & chunkMask) === 0n) {
20552
20683
  dependentEntries.delete(entryIndex);
20553
20684
  }
20554
20685
  }
@@ -21435,6 +21566,7 @@ class Bundle {
21435
21566
  this.pluginDriver.setChunkInformation(this.facadeChunkByModule);
21436
21567
  for (const chunk of chunks) {
21437
21568
  chunk.generateExports();
21569
+ chunk.inlineTransitiveImports();
21438
21570
  }
21439
21571
  timeEnd('generate chunks', 2);
21440
21572
  await renderChunks(chunks, outputBundle, this.pluginDriver, this.outputOptions, this.inputOptions.onLog);
@@ -23047,11 +23179,28 @@ async function rollupInternal(rawInputOptions, watcher) {
23047
23179
  if (watchFiles.length > 0) {
23048
23180
  error_.watchFiles = watchFiles;
23049
23181
  }
23050
- await graph.pluginDriver.hookParallel('buildEnd', [error_]);
23051
- await graph.pluginDriver.hookParallel('closeBundle', []);
23182
+ try {
23183
+ await graph.pluginDriver.hookParallel('buildEnd', [error_]);
23184
+ }
23185
+ catch (buildEndError) {
23186
+ // Create a compound error object to include both errors, based on the original error
23187
+ const compoundError = parseAst_js.getRollupError({
23188
+ ...error_,
23189
+ message: `There was an error during the build:\n ${error_.message}\nAdditionally, handling the error in the 'buildEnd' hook caused the following error:\n ${buildEndError.message}`
23190
+ });
23191
+ await graph.pluginDriver.hookParallel('closeBundle', [compoundError]);
23192
+ throw compoundError;
23193
+ }
23194
+ await graph.pluginDriver.hookParallel('closeBundle', [error_]);
23052
23195
  throw error_;
23053
23196
  }
23054
- await graph.pluginDriver.hookParallel('buildEnd', []);
23197
+ try {
23198
+ await graph.pluginDriver.hookParallel('buildEnd', []);
23199
+ }
23200
+ catch (buildEndError) {
23201
+ await graph.pluginDriver.hookParallel('closeBundle', [buildEndError]);
23202
+ throw buildEndError;
23203
+ }
23055
23204
  });
23056
23205
  timeEnd('BUILD', 1);
23057
23206
  const result = {
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.34.9
4
- Sat, 01 Mar 2025 07:32:06 GMT - commit 0ab9b9772e24dfe9ef08bfce3132e99a15b793f6
3
+ Rollup.js v4.36.0
4
+ Mon, 17 Mar 2025 08:35:11 GMT - commit ab7bfa8fe9c25e41cc62058fa2dcde6b321fd51d
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.34.9
4
- Sat, 01 Mar 2025 07:32:06 GMT - commit 0ab9b9772e24dfe9ef08bfce3132e99a15b793f6
3
+ Rollup.js v4.36.0
4
+ Mon, 17 Mar 2025 08:35:11 GMT - commit ab7bfa8fe9c25e41cc62058fa2dcde6b321fd51d
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rollup/wasm-node",
3
- "version": "4.34.9",
3
+ "version": "4.36.0",
4
4
  "description": "Next-generation ES module bundler with Node wasm",
5
5
  "main": "dist/rollup.js",
6
6
  "module": "dist/es/rollup.js",
@@ -35,34 +35,34 @@
35
35
  "@codemirror/commands": "^6.8.0",
36
36
  "@codemirror/lang-javascript": "^6.2.3",
37
37
  "@codemirror/language": "^6.10.8",
38
- "@codemirror/search": "^6.5.9",
38
+ "@codemirror/search": "^6.5.10",
39
39
  "@codemirror/state": "^6.5.2",
40
- "@codemirror/view": "^6.36.3",
41
- "@eslint/js": "^9.21.0",
42
- "@inquirer/prompts": "^7.3.2",
40
+ "@codemirror/view": "^6.36.4",
41
+ "@eslint/js": "^9.22.0",
42
+ "@inquirer/prompts": "^7.3.3",
43
43
  "@jridgewell/sourcemap-codec": "^1.5.0",
44
44
  "@mermaid-js/mermaid-cli": "^11.4.2",
45
45
  "@napi-rs/cli": "^2.18.4",
46
46
  "@rollup/plugin-alias": "^5.1.1",
47
47
  "@rollup/plugin-buble": "^1.0.3",
48
- "@rollup/plugin-commonjs": "^28.0.2",
48
+ "@rollup/plugin-commonjs": "^28.0.3",
49
49
  "@rollup/plugin-json": "^6.1.0",
50
50
  "@rollup/plugin-node-resolve": "^16.0.0",
51
51
  "@rollup/plugin-replace": "^6.0.2",
52
52
  "@rollup/plugin-terser": "^0.4.4",
53
53
  "@rollup/plugin-typescript": "^12.1.2",
54
54
  "@rollup/pluginutils": "^5.1.4",
55
- "@shikijs/vitepress-twoslash": "^3.0.0",
55
+ "@shikijs/vitepress-twoslash": "^3.1.0",
56
56
  "@types/mocha": "^10.0.10",
57
- "@types/node": "^18.19.76",
57
+ "@types/node": "^18.19.80",
58
58
  "@types/semver": "^7.5.8",
59
59
  "@types/yargs-parser": "^21.0.3",
60
- "@vue/language-server": "^2.2.4",
61
- "acorn": "^8.14.0",
60
+ "@vue/language-server": "^2.2.8",
61
+ "acorn": "^8.14.1",
62
62
  "acorn-import-assertions": "^1.9.0",
63
63
  "acorn-jsx": "^5.3.2",
64
64
  "buble": "^0.20.0",
65
- "builtin-modules": "^4.0.0",
65
+ "builtin-modules": "^5.0.0",
66
66
  "chokidar": "^3.6.0",
67
67
  "concurrently": "^9.1.2",
68
68
  "core-js": "3.38.1",
@@ -70,11 +70,11 @@
70
70
  "date-time": "^4.0.0",
71
71
  "es5-shim": "^4.6.7",
72
72
  "es6-shim": "^0.35.8",
73
- "eslint": "^9.21.0",
74
- "eslint-config-prettier": "^10.0.1",
73
+ "eslint": "^9.22.0",
74
+ "eslint-config-prettier": "^10.1.1",
75
75
  "eslint-plugin-prettier": "^5.2.3",
76
- "eslint-plugin-unicorn": "^56.0.1",
77
- "eslint-plugin-vue": "^9.32.0",
76
+ "eslint-plugin-unicorn": "^57.0.0",
77
+ "eslint-plugin-vue": "^10.0.0",
78
78
  "fixturify": "^3.0.0",
79
79
  "flru": "^1.0.2",
80
80
  "fs-extra": "^11.3.0",
@@ -91,12 +91,12 @@
91
91
  "nyc": "^17.1.0",
92
92
  "picocolors": "^1.1.1",
93
93
  "pinia": "^3.0.1",
94
- "prettier": "^3.5.2",
94
+ "prettier": "^3.5.3",
95
95
  "prettier-plugin-organize-imports": "^4.1.0",
96
96
  "pretty-bytes": "^6.1.1",
97
97
  "pretty-ms": "^9.2.0",
98
98
  "requirejs": "^2.3.7",
99
- "rollup": "^4.34.8",
99
+ "rollup": "^4.35.0",
100
100
  "rollup-plugin-license": "^3.6.0",
101
101
  "rollup-plugin-string": "^3.0.0",
102
102
  "semver": "^7.7.1",
@@ -107,17 +107,17 @@
107
107
  "systemjs": "^6.15.1",
108
108
  "terser": "^5.39.0",
109
109
  "tslib": "^2.8.1",
110
- "typescript": "^5.7.3",
111
- "typescript-eslint": "^8.25.0",
112
- "vite": "^6.2.0",
110
+ "typescript": "^5.8.2",
111
+ "typescript-eslint": "^8.26.1",
112
+ "vite": "^6.2.1",
113
113
  "vitepress": "^1.6.3",
114
114
  "vue": "^3.5.13",
115
- "vue-tsc": "^2.2.4",
115
+ "vue-tsc": "^2.2.8",
116
116
  "wasm-pack": "^0.13.1",
117
117
  "yargs-parser": "^21.1.1"
118
118
  },
119
119
  "overrides": {
120
- "axios": "^1.7.9",
120
+ "axios": "^1.8.3",
121
121
  "semver": "^7.7.1",
122
122
  "readable-stream": "npm:@built-in/readable-stream@1",
123
123
  "esbuild": ">0.24.2"