@rollup/wasm-node 4.68.7 → 4.68.8

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.
package/dist/bin/rollup CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  /*
3
3
  @license
4
- Rollup.js v4.68.7
5
- Wed, 18 Nov 2026 14:37:29 GMT - commit dd75c77b718581406bd6886f84dfdf2ebf50c5e7
4
+ Rollup.js v4.68.8
5
+ Sat, 21 Nov 2026 06:53:43 GMT - commit a845aca377e70a43bab0575931f2d403de1c35fa
6
6
 
7
7
  https://github.com/rollup/rollup
8
8
 
@@ -27,7 +27,7 @@ require('node:perf_hooks');
27
27
  require('node:url');
28
28
  require('../getLogFilter.js');
29
29
 
30
- const help = "rollup version 4.68.7\n=====================================\n\nUsage: rollup [options] <entry file>\n\nOptions:\n\n-c, --config <filename> Use this config file (if argument is used but value\n is unspecified, Rollup will try to load configuration files in\n the following order:\n rollup.config.mjs -> rollup.config.cjs -> rollup.config.js)\n-d, --dir <dirname> Directory for chunks (if absent, prints to stdout)\n-e, --external <ids> Comma-separate list of module IDs to exclude\n-f, --format <format> Type of output (amd, cjs, es, iife, umd, system)\n-g, --globals <pairs> Comma-separate list of `moduleID:Global` pairs\n-h, --help Show this help message\n-i, --input <filename> Input (alternative to <entry file>)\n-m, --sourcemap Generate sourcemap (`-m inline` for inline map)\n-n, --name <name> Name for UMD export\n-o, --file <output> Single output file (if absent, prints to stdout)\n-p, --plugin <plugin> Use the plugin specified (may be repeated)\n-v, --version Show version number\n-w, --watch Watch files in bundle and rebuild on changes\n--amd.autoId Generate the AMD ID based off the chunk name\n--amd.basePath <prefix> Path to prepend to auto generated AMD ID\n--amd.define <name> Function to use in place of `define`\n--amd.forceJsExtensionForImports Use `.js` extension in AMD imports\n--amd.id <id> ID for AMD module (default is anonymous)\n--assetFileNames <pattern> Name pattern for emitted assets\n--banner <text> Code to insert at top of bundle (outside wrapper)\n--chunkFileNames <pattern> Name pattern for emitted secondary chunks\n--compact Minify wrapper code\n--context <variable> Specify top-level `this` value\n--no-dynamicImportInCjs Write external dynamic CommonJS imports as require\n--entryFileNames <pattern> Name pattern for emitted entry chunks\n--environment <values> Settings passed to config file (see example)\n--no-esModule Do not add __esModule property\n--exports <mode> Specify export mode (auto, default, named, none)\n--extend Extend global variable defined by --name\n--no-externalImportAttributes Omit import attributes in \"es\" output\n--no-externalLiveBindings Do not generate code to support live bindings\n--failAfterWarnings Exit with an error if the build produced warnings\n--filterLogs <filter> Filter log messages\n--footer <text> Code to insert at end of bundle (outside wrapper)\n--forceExit Force exit the process when done\n--no-freeze Do not freeze namespace objects\n--generatedCode <preset> Which code features to use (es5/es2015)\n--generatedCode.arrowFunctions Use arrow functions in generated code\n--generatedCode.constBindings Use \"const\" in generated code\n--generatedCode.objectShorthand Use shorthand properties in generated code\n--no-generatedCode.reservedNamesAsProps Always quote reserved names as props\n--generatedCode.symbols Use symbols in generated code\n--hashCharacters <name> Use the specified character set for file hashes\n--no-hoistTransitiveImports Do not hoist transitive imports into entry chunks\n--importAttributesKey <name> Use the specified keyword for import attributes\n--no-indent Don't indent result\n--inlineDynamicImports Create single bundle when using dynamic imports\n--interop <value> Interop mode for external imports (compat, auto,\n esModule, default, defaultOnly)\n--intro <text> Code to insert at top of bundle (inside wrapper)\n--logLevel <level> Which kind of logs to display\n--no-makeAbsoluteExternalsRelative Prevent normalization of external imports\n--maxParallelFileOps <value> How many files to read in parallel\n--minifyInternalExports Force or disable minification of internal exports\n--noConflict Generate a noConflict method for UMD globals\n--outro <text> Code to insert at end of bundle (inside wrapper)\n--perf Display performance timings\n--no-preserveEntrySignatures Avoid facade chunks for entry points\n--preserveModules Preserve module structure\n--preserveModulesRoot Put preserved modules under this path at root level\n--preserveSymlinks Do not follow symlinks when resolving files\n--no-reexportProtoFromExternal Ignore `__proto__` in star re-exports\n--no-sanitizeFileName Do not replace invalid characters in file names\n--shimMissingExports Create shim variables for missing exports\n--silent Don't print warnings\n--sourcemapBaseUrl <url> Emit absolute sourcemap URLs with given base\n--sourcemapDebugIds Emit unique debug ids in source and sourcemaps\n--sourcemapExcludeSources Do not include source code in source maps\n--sourcemapFile <file> Specify bundle position for source maps\n--sourcemapFileNames <pattern> Name pattern for emitted sourcemaps\n--stdin=ext Specify file extension used for stdin input\n--no-stdin Do not read \"-\" from stdin\n--no-strict Don't emit `\"use strict\";` in the generated modules\n--strictDeprecations Throw errors for deprecated features\n--no-systemNullSetters Do not replace empty SystemJS setters with `null`\n--no-treeshake Disable tree-shaking optimisations\n--no-treeshake.annotations Ignore pure call annotations\n--treeshake.correctVarValueBeforeDeclaration Deoptimize variables until declared\n--treeshake.manualPureFunctions <names> Manually declare functions as pure\n--no-treeshake.moduleSideEffects Assume modules have no side effects\n--no-treeshake.propertyReadSideEffects Ignore property access side effects\n--no-treeshake.tryCatchDeoptimization Do not turn off try-catch-tree-shaking\n--no-treeshake.unknownGlobalSideEffects Assume unknown globals do not throw\n--validate Validate output\n--waitForBundleInput Wait for bundle input files\n--watch.allowInputInsideOutputPath Whether the input path is allowed to be a\n subpath of the output path\n--watch.buildDelay <number> Throttle watch rebuilds\n--no-watch.clearScreen Do not clear the screen when rebuilding\n--watch.exclude <files> Exclude files from being watched\n--watch.include <files> Limit watching to specified files\n--watch.onBundleEnd <cmd> Shell command to run on `\"BUNDLE_END\"` event\n--watch.onBundleStart <cmd> Shell command to run on `\"BUNDLE_START\"` event\n--watch.onEnd <cmd> Shell command to run on `\"END\"` event\n--watch.onError <cmd> Shell command to run on `\"ERROR\"` event\n--watch.onStart <cmd> Shell command to run on `\"START\"` event\n--watch.skipWrite Do not write files to disk when watching\n\nExamples:\n\n# use settings in config file\nrollup -c\n\n# in config file, process.env.INCLUDE_DEPS === 'true'\n# and process.env.BUILD === 'production'\nrollup -c --environment INCLUDE_DEPS,BUILD:production\n\n# create CommonJS bundle.js from src/main.js\nrollup --format=cjs --file=bundle.js -- src/main.js\n\n# create self-executing IIFE using `window.jQuery`\n# and `window._` as external globals\nrollup -f iife --globals jquery:jQuery,lodash:_ \\\n -i src/app.js -o build/app.js -m build/app.js.map\n\nNotes:\n\n* When piping to stdout, only inline sourcemaps are permitted\n\nFor more information visit https://rollupjs.org\n";
30
+ const help = "rollup version 4.68.8\n=====================================\n\nUsage: rollup [options] <entry file>\n\nOptions:\n\n-c, --config <filename> Use this config file (if argument is used but value\n is unspecified, Rollup will try to load configuration files in\n the following order:\n rollup.config.mjs -> rollup.config.cjs -> rollup.config.js)\n-d, --dir <dirname> Directory for chunks (if absent, prints to stdout)\n-e, --external <ids> Comma-separate list of module IDs to exclude\n-f, --format <format> Type of output (amd, cjs, es, iife, umd, system)\n-g, --globals <pairs> Comma-separate list of `moduleID:Global` pairs\n-h, --help Show this help message\n-i, --input <filename> Input (alternative to <entry file>)\n-m, --sourcemap Generate sourcemap (`-m inline` for inline map)\n-n, --name <name> Name for UMD export\n-o, --file <output> Single output file (if absent, prints to stdout)\n-p, --plugin <plugin> Use the plugin specified (may be repeated)\n-v, --version Show version number\n-w, --watch Watch files in bundle and rebuild on changes\n--amd.autoId Generate the AMD ID based off the chunk name\n--amd.basePath <prefix> Path to prepend to auto generated AMD ID\n--amd.define <name> Function to use in place of `define`\n--amd.forceJsExtensionForImports Use `.js` extension in AMD imports\n--amd.id <id> ID for AMD module (default is anonymous)\n--assetFileNames <pattern> Name pattern for emitted assets\n--banner <text> Code to insert at top of bundle (outside wrapper)\n--chunkFileNames <pattern> Name pattern for emitted secondary chunks\n--compact Minify wrapper code\n--context <variable> Specify top-level `this` value\n--no-dynamicImportInCjs Write external dynamic CommonJS imports as require\n--entryFileNames <pattern> Name pattern for emitted entry chunks\n--environment <values> Settings passed to config file (see example)\n--no-esModule Do not add __esModule property\n--exports <mode> Specify export mode (auto, default, named, none)\n--extend Extend global variable defined by --name\n--no-externalImportAttributes Omit import attributes in \"es\" output\n--no-externalLiveBindings Do not generate code to support live bindings\n--failAfterWarnings Exit with an error if the build produced warnings\n--filterLogs <filter> Filter log messages\n--footer <text> Code to insert at end of bundle (outside wrapper)\n--forceExit Force exit the process when done\n--no-freeze Do not freeze namespace objects\n--generatedCode <preset> Which code features to use (es5/es2015)\n--generatedCode.arrowFunctions Use arrow functions in generated code\n--generatedCode.constBindings Use \"const\" in generated code\n--generatedCode.objectShorthand Use shorthand properties in generated code\n--no-generatedCode.reservedNamesAsProps Always quote reserved names as props\n--generatedCode.symbols Use symbols in generated code\n--hashCharacters <name> Use the specified character set for file hashes\n--no-hoistTransitiveImports Do not hoist transitive imports into entry chunks\n--importAttributesKey <name> Use the specified keyword for import attributes\n--no-indent Don't indent result\n--inlineDynamicImports Create single bundle when using dynamic imports\n--interop <value> Interop mode for external imports (compat, auto,\n esModule, default, defaultOnly)\n--intro <text> Code to insert at top of bundle (inside wrapper)\n--logLevel <level> Which kind of logs to display\n--no-makeAbsoluteExternalsRelative Prevent normalization of external imports\n--maxParallelFileOps <value> How many files to read in parallel\n--minifyInternalExports Force or disable minification of internal exports\n--noConflict Generate a noConflict method for UMD globals\n--outro <text> Code to insert at end of bundle (inside wrapper)\n--perf Display performance timings\n--no-preserveEntrySignatures Avoid facade chunks for entry points\n--preserveModules Preserve module structure\n--preserveModulesRoot Put preserved modules under this path at root level\n--preserveSymlinks Do not follow symlinks when resolving files\n--no-reexportProtoFromExternal Ignore `__proto__` in star re-exports\n--no-sanitizeFileName Do not replace invalid characters in file names\n--shimMissingExports Create shim variables for missing exports\n--silent Don't print warnings\n--sourcemapBaseUrl <url> Emit absolute sourcemap URLs with given base\n--sourcemapDebugIds Emit unique debug ids in source and sourcemaps\n--sourcemapExcludeSources Do not include source code in source maps\n--sourcemapFile <file> Specify bundle position for source maps\n--sourcemapFileNames <pattern> Name pattern for emitted sourcemaps\n--stdin=ext Specify file extension used for stdin input\n--no-stdin Do not read \"-\" from stdin\n--no-strict Don't emit `\"use strict\";` in the generated modules\n--strictDeprecations Throw errors for deprecated features\n--no-systemNullSetters Do not replace empty SystemJS setters with `null`\n--no-treeshake Disable tree-shaking optimisations\n--no-treeshake.annotations Ignore pure call annotations\n--treeshake.correctVarValueBeforeDeclaration Deoptimize variables until declared\n--treeshake.manualPureFunctions <names> Manually declare functions as pure\n--no-treeshake.moduleSideEffects Assume modules have no side effects\n--no-treeshake.propertyReadSideEffects Ignore property access side effects\n--no-treeshake.tryCatchDeoptimization Do not turn off try-catch-tree-shaking\n--no-treeshake.unknownGlobalSideEffects Assume unknown globals do not throw\n--validate Validate output\n--waitForBundleInput Wait for bundle input files\n--watch.allowInputInsideOutputPath Whether the input path is allowed to be a\n subpath of the output path\n--watch.buildDelay <number> Throttle watch rebuilds\n--no-watch.clearScreen Do not clear the screen when rebuilding\n--watch.exclude <files> Exclude files from being watched\n--watch.include <files> Limit watching to specified files\n--watch.onBundleEnd <cmd> Shell command to run on `\"BUNDLE_END\"` event\n--watch.onBundleStart <cmd> Shell command to run on `\"BUNDLE_START\"` event\n--watch.onEnd <cmd> Shell command to run on `\"END\"` event\n--watch.onError <cmd> Shell command to run on `\"ERROR\"` event\n--watch.onStart <cmd> Shell command to run on `\"START\"` event\n--watch.skipWrite Do not write files to disk when watching\n\nExamples:\n\n# use settings in config file\nrollup -c\n\n# in config file, process.env.INCLUDE_DEPS === 'true'\n# and process.env.BUILD === 'production'\nrollup -c --environment INCLUDE_DEPS,BUILD:production\n\n# create CommonJS bundle.js from src/main.js\nrollup --format=cjs --file=bundle.js -- src/main.js\n\n# create self-executing IIFE using `window.jQuery`\n# and `window._` as external globals\nrollup -f iife --globals jquery:jQuery,lodash:_ \\\n -i src/app.js -o build/app.js -m build/app.js.map\n\nNotes:\n\n* When piping to stdout, only inline sourcemaps are permitted\n\nFor more information visit https://rollupjs.org\n";
31
31
 
32
32
  /**
33
33
  * @license
@@ -2002,13 +2002,6 @@ else if (command.version) {
2002
2002
  console.log(`rollup v${rollup.package_.version}`);
2003
2003
  }
2004
2004
  else {
2005
- try {
2006
- // eslint-disable-next-line @typescript-eslint/no-require-imports
2007
- require('source-map-support').install();
2008
- }
2009
- catch {
2010
- // do nothing
2011
- }
2012
2005
  const promise = runRollup(command);
2013
2006
  if (command.forceExit) {
2014
2007
  promise.then(() => process$1.exit());
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.68.7
4
- Wed, 18 Nov 2026 14:37:29 GMT - commit dd75c77b718581406bd6886f84dfdf2ebf50c5e7
3
+ Rollup.js v4.68.8
4
+ Sat, 21 Nov 2026 06:53:43 GMT - commit a845aca377e70a43bab0575931f2d403de1c35fa
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.68.7
4
- Wed, 18 Nov 2026 14:37:29 GMT - commit dd75c77b718581406bd6886f84dfdf2ebf50c5e7
3
+ Rollup.js v4.68.8
4
+ Sat, 21 Nov 2026 06:53:43 GMT - commit a845aca377e70a43bab0575931f2d403de1c35fa
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/dist/es/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.68.7
4
- Wed, 18 Nov 2026 14:37:29 GMT - commit dd75c77b718581406bd6886f84dfdf2ebf50c5e7
3
+ Rollup.js v4.68.8
4
+ Sat, 21 Nov 2026 06:53:43 GMT - commit a845aca377e70a43bab0575931f2d403de1c35fa
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.68.7
4
- Wed, 18 Nov 2026 14:37:29 GMT - commit dd75c77b718581406bd6886f84dfdf2ebf50c5e7
3
+ Rollup.js v4.68.8
4
+ Sat, 21 Nov 2026 06:53:43 GMT - commit a845aca377e70a43bab0575931f2d403de1c35fa
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -27,7 +27,7 @@ function _mergeNamespaces(n, m) {
27
27
  return Object.defineProperty(n, Symbol.toStringTag, { value: 'Module' });
28
28
  }
29
29
 
30
- var version = "4.68.7";
30
+ var version = "4.68.8";
31
31
  const pkg = {
32
32
  version: version};
33
33
 
@@ -9531,6 +9531,13 @@ class NamespaceVariable extends Variable {
9531
9531
  addReference(identifier) {
9532
9532
  this.references.push(identifier);
9533
9533
  this.name = identifier.name;
9534
+ this.markReferencedFrom(identifier);
9535
+ }
9536
+ addUsedPlace(usedPlace) {
9537
+ super.addUsedPlace(usedPlace);
9538
+ // This also covers accesses like `otherNamespace.namespace` that are
9539
+ // resolved to this variable without an identifier reference
9540
+ this.markReferencedFrom(usedPlace);
9534
9541
  }
9535
9542
  deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) {
9536
9543
  if (path.length > 1 || (path.length === 1 && interaction.type === INTERACTION_CALLED)) {
@@ -9607,14 +9614,14 @@ class NamespaceVariable extends Variable {
9607
9614
  this.module.scope.addAccessedGlobals([MERGE_NAMESPACES_VARIABLE], accessedGlobalsByScope);
9608
9615
  }
9609
9616
  }
9610
- renderBlock(options) {
9617
+ renderBlock(options, isHoisted) {
9611
9618
  const { exportNamesByVariable, format, freeze, indent: t, symbols, snippets: { _, cnst, getObject, getPropertyAccess, n, s } } = options;
9612
9619
  const memberVariables = this.module.getExportedVariablesByName();
9613
9620
  const members = [...memberVariables.entries()]
9614
9621
  .filter(([name, variable]) => !isNamespaceExportName(name) && variable.included)
9615
9622
  .map(([name, variable]) => {
9616
9623
  const key = unescapeExportName(name);
9617
- if (this.referencedEarly ||
9624
+ if (isHoisted ||
9618
9625
  variable.isReassigned ||
9619
9626
  variable === this ||
9620
9627
  (variable.module &&
@@ -9649,23 +9656,42 @@ class NamespaceVariable extends Variable {
9649
9656
  }
9650
9657
  return output;
9651
9658
  }
9652
- renderFirst() {
9659
+ getIncludedMemberNamespaces() {
9660
+ const memberNamespaces = [];
9661
+ for (const variable of this.module.getExportedVariablesByName().values()) {
9662
+ if (!variable.included)
9663
+ continue;
9664
+ const namespace = variable instanceof ExportDefaultVariable
9665
+ ? variable.getOriginalNamespaceVariable()
9666
+ : variable;
9667
+ if (namespace instanceof NamespaceVariable && namespace !== this) {
9668
+ memberNamespaces.push(namespace);
9669
+ }
9670
+ }
9671
+ return memberNamespaces;
9672
+ }
9673
+ getMergedNamespaces() {
9674
+ return this.mergedNamespaces;
9675
+ }
9676
+ /**
9677
+ * Whether code that runs before the end of this module can access the
9678
+ * namespace object. The chunk decides if it can actually be created early.
9679
+ */
9680
+ isReferencedEarly() {
9653
9681
  return this.referencedEarly;
9654
9682
  }
9655
9683
  setMergedNamespaces(mergedNamespaces) {
9656
9684
  this.mergedNamespaces = mergedNamespaces;
9657
- const moduleExecIndex = this.context.getModuleExecIndex();
9658
- for (const identifier of this.references) {
9659
- const { context } = identifier.scope;
9660
- if (context.getModuleExecIndex() <= moduleExecIndex) {
9661
- this.referencedEarly = true;
9662
- break;
9663
- }
9664
- }
9665
9685
  }
9666
9686
  getMemberVariable(name) {
9667
9687
  return this.module.getExportedVariablesByName().get(escapeExportName(name));
9668
9688
  }
9689
+ markReferencedFrom(node) {
9690
+ // Module execution order is known once references are bound
9691
+ if (node.scope.context.getModuleExecIndex() <= this.context.getModuleExecIndex()) {
9692
+ this.referencedEarly = true;
9693
+ }
9694
+ }
9669
9695
  includeNonExplicitNamespaces() {
9670
9696
  if (!this.nonExplicitNamespacesIncluded) {
9671
9697
  this.nonExplicitNamespacesIncluded = true;
@@ -20791,6 +20817,55 @@ class Chunk {
20791
20817
  }
20792
20818
  }
20793
20819
  }
20820
+ // Namespace objects that can be read before their module ran are created at
20821
+ // the top of the chunk. This is computed per chunk as it depends on which
20822
+ // modules are part of it.
20823
+ getHoistedNamespaces() {
20824
+ const namespaces = [];
20825
+ for (const module of this.orderedModules) {
20826
+ if (this.includedNamespaces.has(module)) {
20827
+ namespaces.push(module.namespace);
20828
+ }
20829
+ }
20830
+ const hoistedNamespaces = new Set();
20831
+ for (const namespace of namespaces) {
20832
+ if (namespace.isReferencedEarly() && this.canHoistNamespace(namespace)) {
20833
+ hoistedNamespaces.add(namespace);
20834
+ }
20835
+ }
20836
+ // A namespace object that is a member of another namespace object can be
20837
+ // read through that object as soon as it is created. Repeat until nothing
20838
+ // changes to cover chains of namespaces.
20839
+ let hasHoistedNamespace = true;
20840
+ while (hasHoistedNamespace) {
20841
+ hasHoistedNamespace = false;
20842
+ for (const namespace of namespaces) {
20843
+ const isNamespaceHoisted = hoistedNamespaces.has(namespace);
20844
+ for (const memberNamespace of namespace.getIncludedMemberNamespaces()) {
20845
+ if (!hoistedNamespaces.has(memberNamespace) &&
20846
+ this.chunkByModule.get(memberNamespace.module) === this &&
20847
+ (isNamespaceHoisted || namespace.module.execIndex < memberNamespace.module.execIndex) &&
20848
+ this.canHoistNamespace(memberNamespace)) {
20849
+ hoistedNamespaces.add(memberNamespace);
20850
+ hasHoistedNamespace = true;
20851
+ }
20852
+ }
20853
+ }
20854
+ }
20855
+ return hoistedNamespaces;
20856
+ }
20857
+ // Merged namespaces are read when the namespace object is created. A merged
20858
+ // namespace that is rendered as a variable of this chunk does not exist yet
20859
+ // at the top of the chunk.
20860
+ canHoistNamespace(namespace) {
20861
+ for (const variable of namespace.getMergedNamespaces()) {
20862
+ const { module } = getRenderedVariable(variable);
20863
+ if (module instanceof Module && this.chunkByModule.get(module) === this) {
20864
+ return false;
20865
+ }
20866
+ }
20867
+ return true;
20868
+ }
20794
20869
  // This method changes properties on the AST before rendering and must not be async
20795
20870
  renderModules(fileName) {
20796
20871
  const { accessedGlobalsByScope, dependencies, exportNamesByVariable, includedNamespaces, inputOptions: { onLog }, isEmpty, orderedModules, outputOptions, pluginDriver, renderedModules, snippets } = this;
@@ -20799,6 +20874,7 @@ class Chunk {
20799
20874
  this.setDynamicImportResolutions(fileName);
20800
20875
  this.setImportMetaResolutions(fileName);
20801
20876
  this.setIdentifierRenderResolutions();
20877
+ const hoistedNamespaces = this.getHoistedNamespaces();
20802
20878
  const magicString = new Bundle$1({ separator: `${n}${n}` });
20803
20879
  const indent = getIndentString(orderedModules, outputOptions);
20804
20880
  const usedModules = [];
@@ -20841,8 +20917,9 @@ class Chunk {
20841
20917
  }
20842
20918
  const namespace = module.namespace;
20843
20919
  if (includedNamespaces.has(module)) {
20844
- const rendered = namespace.renderBlock(renderOptions);
20845
- if (namespace.renderFirst())
20920
+ const isHoisted = hoistedNamespaces.has(namespace);
20921
+ const rendered = namespace.renderBlock(renderOptions, isHoisted);
20922
+ if (isHoisted)
20846
20923
  hoistedSource += n + rendered;
20847
20924
  else
20848
20925
  magicString.addSource(new MagicString(rendered));
@@ -20960,13 +21037,8 @@ class Chunk {
20960
21037
  }
20961
21038
  }
20962
21039
  }
20963
- for (let variable of moduleImports) {
20964
- if (variable instanceof ExportDefaultVariable) {
20965
- variable = variable.getOriginalVariable();
20966
- }
20967
- if (variable instanceof SyntheticNamedExportVariable) {
20968
- variable = variable.getBaseVariable();
20969
- }
21040
+ for (const importedVariable of moduleImports) {
21041
+ const variable = getRenderedVariable(importedVariable);
20970
21042
  const chunk = this.chunkByModule.get(variable.module);
20971
21043
  if (chunk !== this) {
20972
21044
  this.imports.add(variable);
@@ -20997,6 +21069,15 @@ class Chunk {
20997
21069
  }
20998
21070
  }
20999
21071
  }
21072
+ function getRenderedVariable(variable) {
21073
+ if (variable instanceof ExportDefaultVariable) {
21074
+ variable = variable.getOriginalVariable();
21075
+ }
21076
+ if (variable instanceof SyntheticNamedExportVariable) {
21077
+ variable = variable.getBaseVariable();
21078
+ }
21079
+ return variable;
21080
+ }
21000
21081
  function getChunkNameFromModule(module) {
21001
21082
  return getPredefinedChunkNameFromModule(module) ?? getAliasName(module.id);
21002
21083
  }
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.68.7
4
- Wed, 18 Nov 2026 14:37:29 GMT - commit dd75c77b718581406bd6886f84dfdf2ebf50c5e7
3
+ Rollup.js v4.68.8
4
+ Sat, 21 Nov 2026 06:53:43 GMT - commit a845aca377e70a43bab0575931f2d403de1c35fa
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.68.7
4
- Wed, 18 Nov 2026 14:37:29 GMT - commit dd75c77b718581406bd6886f84dfdf2ebf50c5e7
3
+ Rollup.js v4.68.8
4
+ Sat, 21 Nov 2026 06:53:43 GMT - commit a845aca377e70a43bab0575931f2d403de1c35fa
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.68.7
4
- Wed, 18 Nov 2026 14:37:29 GMT - commit dd75c77b718581406bd6886f84dfdf2ebf50c5e7
3
+ Rollup.js v4.68.8
4
+ Sat, 21 Nov 2026 06:53:43 GMT - commit a845aca377e70a43bab0575931f2d403de1c35fa
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.68.7
4
- Wed, 18 Nov 2026 14:37:29 GMT - commit dd75c77b718581406bd6886f84dfdf2ebf50c5e7
3
+ Rollup.js v4.68.8
4
+ Sat, 21 Nov 2026 06:53:43 GMT - commit a845aca377e70a43bab0575931f2d403de1c35fa
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/dist/parseAst.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.68.7
4
- Wed, 18 Nov 2026 14:37:29 GMT - commit dd75c77b718581406bd6886f84dfdf2ebf50c5e7
3
+ Rollup.js v4.68.8
4
+ Sat, 21 Nov 2026 06:53:43 GMT - commit a845aca377e70a43bab0575931f2d403de1c35fa
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/dist/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.68.7
4
- Wed, 18 Nov 2026 14:37:29 GMT - commit dd75c77b718581406bd6886f84dfdf2ebf50c5e7
3
+ Rollup.js v4.68.8
4
+ Sat, 21 Nov 2026 06:53:43 GMT - commit a845aca377e70a43bab0575931f2d403de1c35fa
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.68.7
4
- Wed, 18 Nov 2026 14:37:29 GMT - commit dd75c77b718581406bd6886f84dfdf2ebf50c5e7
3
+ Rollup.js v4.68.8
4
+ Sat, 21 Nov 2026 06:53:43 GMT - commit a845aca377e70a43bab0575931f2d403de1c35fa
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.68.7
4
- Wed, 18 Nov 2026 14:37:29 GMT - commit dd75c77b718581406bd6886f84dfdf2ebf50c5e7
3
+ Rollup.js v4.68.8
4
+ Sat, 21 Nov 2026 06:53:43 GMT - commit a845aca377e70a43bab0575931f2d403de1c35fa
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.68.7
4
- Wed, 18 Nov 2026 14:37:29 GMT - commit dd75c77b718581406bd6886f84dfdf2ebf50c5e7
3
+ Rollup.js v4.68.8
4
+ Sat, 21 Nov 2026 06:53:43 GMT - commit a845aca377e70a43bab0575931f2d403de1c35fa
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.68.7
4
- Wed, 18 Nov 2026 14:37:29 GMT - commit dd75c77b718581406bd6886f84dfdf2ebf50c5e7
3
+ Rollup.js v4.68.8
4
+ Sat, 21 Nov 2026 06:53:43 GMT - commit a845aca377e70a43bab0575931f2d403de1c35fa
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.68.7
4
- Wed, 18 Nov 2026 14:37:29 GMT - commit dd75c77b718581406bd6886f84dfdf2ebf50c5e7
3
+ Rollup.js v4.68.8
4
+ Sat, 21 Nov 2026 06:53:43 GMT - commit a845aca377e70a43bab0575931f2d403de1c35fa
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.68.7
4
- Wed, 18 Nov 2026 14:37:29 GMT - commit dd75c77b718581406bd6886f84dfdf2ebf50c5e7
3
+ Rollup.js v4.68.8
4
+ Sat, 21 Nov 2026 06:53:43 GMT - commit a845aca377e70a43bab0575931f2d403de1c35fa
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -42,7 +42,7 @@ function _mergeNamespaces(n, m) {
42
42
 
43
43
  const promises__namespace = /*#__PURE__*/_interopNamespaceDefault(promises);
44
44
 
45
- var version = "4.68.7";
45
+ var version = "4.68.8";
46
46
  const package_ = {
47
47
  version: version};
48
48
 
@@ -13691,6 +13691,13 @@ class NamespaceVariable extends Variable {
13691
13691
  addReference(identifier) {
13692
13692
  this.references.push(identifier);
13693
13693
  this.name = identifier.name;
13694
+ this.markReferencedFrom(identifier);
13695
+ }
13696
+ addUsedPlace(usedPlace) {
13697
+ super.addUsedPlace(usedPlace);
13698
+ // This also covers accesses like `otherNamespace.namespace` that are
13699
+ // resolved to this variable without an identifier reference
13700
+ this.markReferencedFrom(usedPlace);
13694
13701
  }
13695
13702
  deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) {
13696
13703
  if (path.length > 1 || (path.length === 1 && interaction.type === INTERACTION_CALLED)) {
@@ -13767,14 +13774,14 @@ class NamespaceVariable extends Variable {
13767
13774
  this.module.scope.addAccessedGlobals([MERGE_NAMESPACES_VARIABLE], accessedGlobalsByScope);
13768
13775
  }
13769
13776
  }
13770
- renderBlock(options) {
13777
+ renderBlock(options, isHoisted) {
13771
13778
  const { exportNamesByVariable, format, freeze, indent: t, symbols, snippets: { _, cnst, getObject, getPropertyAccess, n, s } } = options;
13772
13779
  const memberVariables = this.module.getExportedVariablesByName();
13773
13780
  const members = [...memberVariables.entries()]
13774
13781
  .filter(([name, variable]) => !isNamespaceExportName(name) && variable.included)
13775
13782
  .map(([name, variable]) => {
13776
13783
  const key = unescapeExportName(name);
13777
- if (this.referencedEarly ||
13784
+ if (isHoisted ||
13778
13785
  variable.isReassigned ||
13779
13786
  variable === this ||
13780
13787
  (variable.module &&
@@ -13809,23 +13816,42 @@ class NamespaceVariable extends Variable {
13809
13816
  }
13810
13817
  return output;
13811
13818
  }
13812
- renderFirst() {
13819
+ getIncludedMemberNamespaces() {
13820
+ const memberNamespaces = [];
13821
+ for (const variable of this.module.getExportedVariablesByName().values()) {
13822
+ if (!variable.included)
13823
+ continue;
13824
+ const namespace = variable instanceof ExportDefaultVariable
13825
+ ? variable.getOriginalNamespaceVariable()
13826
+ : variable;
13827
+ if (namespace instanceof NamespaceVariable && namespace !== this) {
13828
+ memberNamespaces.push(namespace);
13829
+ }
13830
+ }
13831
+ return memberNamespaces;
13832
+ }
13833
+ getMergedNamespaces() {
13834
+ return this.mergedNamespaces;
13835
+ }
13836
+ /**
13837
+ * Whether code that runs before the end of this module can access the
13838
+ * namespace object. The chunk decides if it can actually be created early.
13839
+ */
13840
+ isReferencedEarly() {
13813
13841
  return this.referencedEarly;
13814
13842
  }
13815
13843
  setMergedNamespaces(mergedNamespaces) {
13816
13844
  this.mergedNamespaces = mergedNamespaces;
13817
- const moduleExecIndex = this.context.getModuleExecIndex();
13818
- for (const identifier of this.references) {
13819
- const { context } = identifier.scope;
13820
- if (context.getModuleExecIndex() <= moduleExecIndex) {
13821
- this.referencedEarly = true;
13822
- break;
13823
- }
13824
- }
13825
13845
  }
13826
13846
  getMemberVariable(name) {
13827
13847
  return this.module.getExportedVariablesByName().get(escapeExportName(name));
13828
13848
  }
13849
+ markReferencedFrom(node) {
13850
+ // Module execution order is known once references are bound
13851
+ if (node.scope.context.getModuleExecIndex() <= this.context.getModuleExecIndex()) {
13852
+ this.referencedEarly = true;
13853
+ }
13854
+ }
13829
13855
  includeNonExplicitNamespaces() {
13830
13856
  if (!this.nonExplicitNamespacesIncluded) {
13831
13857
  this.nonExplicitNamespacesIncluded = true;
@@ -22287,6 +22313,55 @@ class Chunk {
22287
22313
  }
22288
22314
  }
22289
22315
  }
22316
+ // Namespace objects that can be read before their module ran are created at
22317
+ // the top of the chunk. This is computed per chunk as it depends on which
22318
+ // modules are part of it.
22319
+ getHoistedNamespaces() {
22320
+ const namespaces = [];
22321
+ for (const module of this.orderedModules) {
22322
+ if (this.includedNamespaces.has(module)) {
22323
+ namespaces.push(module.namespace);
22324
+ }
22325
+ }
22326
+ const hoistedNamespaces = new Set();
22327
+ for (const namespace of namespaces) {
22328
+ if (namespace.isReferencedEarly() && this.canHoistNamespace(namespace)) {
22329
+ hoistedNamespaces.add(namespace);
22330
+ }
22331
+ }
22332
+ // A namespace object that is a member of another namespace object can be
22333
+ // read through that object as soon as it is created. Repeat until nothing
22334
+ // changes to cover chains of namespaces.
22335
+ let hasHoistedNamespace = true;
22336
+ while (hasHoistedNamespace) {
22337
+ hasHoistedNamespace = false;
22338
+ for (const namespace of namespaces) {
22339
+ const isNamespaceHoisted = hoistedNamespaces.has(namespace);
22340
+ for (const memberNamespace of namespace.getIncludedMemberNamespaces()) {
22341
+ if (!hoistedNamespaces.has(memberNamespace) &&
22342
+ this.chunkByModule.get(memberNamespace.module) === this &&
22343
+ (isNamespaceHoisted || namespace.module.execIndex < memberNamespace.module.execIndex) &&
22344
+ this.canHoistNamespace(memberNamespace)) {
22345
+ hoistedNamespaces.add(memberNamespace);
22346
+ hasHoistedNamespace = true;
22347
+ }
22348
+ }
22349
+ }
22350
+ }
22351
+ return hoistedNamespaces;
22352
+ }
22353
+ // Merged namespaces are read when the namespace object is created. A merged
22354
+ // namespace that is rendered as a variable of this chunk does not exist yet
22355
+ // at the top of the chunk.
22356
+ canHoistNamespace(namespace) {
22357
+ for (const variable of namespace.getMergedNamespaces()) {
22358
+ const { module } = getRenderedVariable(variable);
22359
+ if (module instanceof Module && this.chunkByModule.get(module) === this) {
22360
+ return false;
22361
+ }
22362
+ }
22363
+ return true;
22364
+ }
22290
22365
  // This method changes properties on the AST before rendering and must not be async
22291
22366
  renderModules(fileName) {
22292
22367
  const { accessedGlobalsByScope, dependencies, exportNamesByVariable, includedNamespaces, inputOptions: { onLog }, isEmpty, orderedModules, outputOptions, pluginDriver, renderedModules, snippets } = this;
@@ -22295,6 +22370,7 @@ class Chunk {
22295
22370
  this.setDynamicImportResolutions(fileName);
22296
22371
  this.setImportMetaResolutions(fileName);
22297
22372
  this.setIdentifierRenderResolutions();
22373
+ const hoistedNamespaces = this.getHoistedNamespaces();
22298
22374
  const magicString = new Bundle$1({ separator: `${n}${n}` });
22299
22375
  const indent = getIndentString(orderedModules, outputOptions);
22300
22376
  const usedModules = [];
@@ -22337,8 +22413,9 @@ class Chunk {
22337
22413
  }
22338
22414
  const namespace = module.namespace;
22339
22415
  if (includedNamespaces.has(module)) {
22340
- const rendered = namespace.renderBlock(renderOptions);
22341
- if (namespace.renderFirst())
22416
+ const isHoisted = hoistedNamespaces.has(namespace);
22417
+ const rendered = namespace.renderBlock(renderOptions, isHoisted);
22418
+ if (isHoisted)
22342
22419
  hoistedSource += n + rendered;
22343
22420
  else
22344
22421
  magicString.addSource(new MagicString(rendered));
@@ -22456,13 +22533,8 @@ class Chunk {
22456
22533
  }
22457
22534
  }
22458
22535
  }
22459
- for (let variable of moduleImports) {
22460
- if (variable instanceof ExportDefaultVariable) {
22461
- variable = variable.getOriginalVariable();
22462
- }
22463
- if (variable instanceof SyntheticNamedExportVariable) {
22464
- variable = variable.getBaseVariable();
22465
- }
22536
+ for (const importedVariable of moduleImports) {
22537
+ const variable = getRenderedVariable(importedVariable);
22466
22538
  const chunk = this.chunkByModule.get(variable.module);
22467
22539
  if (chunk !== this) {
22468
22540
  this.imports.add(variable);
@@ -22493,6 +22565,15 @@ class Chunk {
22493
22565
  }
22494
22566
  }
22495
22567
  }
22568
+ function getRenderedVariable(variable) {
22569
+ if (variable instanceof ExportDefaultVariable) {
22570
+ variable = variable.getOriginalVariable();
22571
+ }
22572
+ if (variable instanceof SyntheticNamedExportVariable) {
22573
+ variable = variable.getBaseVariable();
22574
+ }
22575
+ return variable;
22576
+ }
22496
22577
  function getChunkNameFromModule(module) {
22497
22578
  return getPredefinedChunkNameFromModule(module) ?? parseAst_js.getAliasName(module.id);
22498
22579
  }
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.68.7
4
- Wed, 18 Nov 2026 14:37:29 GMT - commit dd75c77b718581406bd6886f84dfdf2ebf50c5e7
3
+ Rollup.js v4.68.8
4
+ Sat, 21 Nov 2026 06:53:43 GMT - commit a845aca377e70a43bab0575931f2d403de1c35fa
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.68.7
4
- Wed, 18 Nov 2026 14:37:29 GMT - commit dd75c77b718581406bd6886f84dfdf2ebf50c5e7
3
+ Rollup.js v4.68.8
4
+ Sat, 21 Nov 2026 06:53:43 GMT - commit a845aca377e70a43bab0575931f2d403de1c35fa
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.68.7",
3
+ "version": "4.68.8",
4
4
  "description": "Next-generation ES module bundler with Node wasm",
5
5
  "main": "dist/rollup.js",
6
6
  "module": "dist/es/rollup.js",
@@ -77,10 +77,10 @@
77
77
  "date-time": "^4.0.0",
78
78
  "es5-shim": "^4.6.7",
79
79
  "es6-shim": "^0.35.8",
80
- "eslint": "^10.14.0",
80
+ "eslint": "^10.15.0",
81
81
  "eslint-config-prettier": "^10.1.8",
82
82
  "eslint-plugin-prettier": "^5.5.7",
83
- "eslint-plugin-unicorn": "^79.0.0",
83
+ "eslint-plugin-unicorn": "^80.0.0",
84
84
  "eslint-plugin-vue": "^10.12.1",
85
85
  "fixturify": "^3.0.0",
86
86
  "flru": "^1.0.2",
@@ -89,10 +89,10 @@
89
89
  "globals": "^17.14.0",
90
90
  "husky": "^9.1.7",
91
91
  "is-reference": "^3.0.3",
92
- "lint-staged": "^17.6.0",
92
+ "lint-staged": "^17.6.1",
93
93
  "locate-character": "^3.0.0",
94
94
  "magic-string": "^1.4.5",
95
- "memfs": "^4.80.0",
95
+ "memfs": "^4.80.1",
96
96
  "mocha": "^11.8.0",
97
97
  "nodemon": "^3.1.14",
98
98
  "npm-audit-resolver": "^3.0.0-RC.0",
@@ -101,23 +101,22 @@
101
101
  "picocolors": "^1.1.1",
102
102
  "picomatch": "^4.0.7",
103
103
  "pinia": "^4.1.0",
104
- "prettier": "^3.9.10",
104
+ "prettier": "^3.10.1",
105
105
  "prettier-plugin-organize-imports": "^4.3.0",
106
106
  "pretty-bytes": "^7.2.0",
107
107
  "pretty-ms": "^9.3.1",
108
108
  "requirejs": "^2.3.8",
109
- "rollup": "^4.68.2",
109
+ "rollup": "^4.68.4",
110
110
  "rollup-plugin-license": "^3.7.2",
111
111
  "semver": "^7.8.6",
112
112
  "shx": "^0.4.0",
113
113
  "signal-exit": "^4.1.0",
114
114
  "source-map": "^0.8.0",
115
- "source-map-support": "^0.5.21",
116
115
  "systemjs": "^6.15.1",
117
116
  "terser": "^5.51.2",
118
117
  "tslib": "^2.9.1",
119
118
  "typescript": "^5.9.3",
120
- "typescript-eslint": "^8.72.2",
119
+ "typescript-eslint": "^8.73.0",
121
120
  "vite": "^7.3.8",
122
121
  "vitepress": "^1.6.4",
123
122
  "vue": "^3.5.45",