@rollup/wasm-node 4.63.4 → 4.63.5

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.63.4
5
- Sat, 19 Sep 2026 06:35:38 GMT - commit ba78d5752a1e1ff4ff4af3a8bffab7691d822f7d
4
+ Rollup.js v4.63.5
5
+ Thu, 24 Sep 2026 10:07:23 GMT - commit 3722484c33c58b3ab0cbbfcca09b8f267d420329
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.63.4\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--no-interop Do not include interop block\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.63.5\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--no-interop Do not include interop block\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
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.63.4
4
- Sat, 19 Sep 2026 06:35:38 GMT - commit ba78d5752a1e1ff4ff4af3a8bffab7691d822f7d
3
+ Rollup.js v4.63.5
4
+ Thu, 24 Sep 2026 10:07:23 GMT - commit 3722484c33c58b3ab0cbbfcca09b8f267d420329
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.63.4
4
- Sat, 19 Sep 2026 06:35:38 GMT - commit ba78d5752a1e1ff4ff4af3a8bffab7691d822f7d
3
+ Rollup.js v4.63.5
4
+ Thu, 24 Sep 2026 10:07:23 GMT - commit 3722484c33c58b3ab0cbbfcca09b8f267d420329
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.63.4
4
- Sat, 19 Sep 2026 06:35:38 GMT - commit ba78d5752a1e1ff4ff4af3a8bffab7691d822f7d
3
+ Rollup.js v4.63.5
4
+ Thu, 24 Sep 2026 10:07:23 GMT - commit 3722484c33c58b3ab0cbbfcca09b8f267d420329
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.63.4
4
- Sat, 19 Sep 2026 06:35:38 GMT - commit ba78d5752a1e1ff4ff4af3a8bffab7691d822f7d
3
+ Rollup.js v4.63.5
4
+ Thu, 24 Sep 2026 10:07:23 GMT - commit 3722484c33c58b3ab0cbbfcca09b8f267d420329
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.63.4";
30
+ var version = "4.63.5";
31
31
  const pkg = {
32
32
  version: version};
33
33
 
@@ -8685,6 +8685,8 @@ const builtinModules = [
8685
8685
  "assert/strict",
8686
8686
  "node:async_hooks",
8687
8687
  "async_hooks",
8688
+ "node:bench",
8689
+ "node:bench/reporters",
8688
8690
  "node:buffer",
8689
8691
  "buffer",
8690
8692
  "node:child_process",
@@ -20147,7 +20149,7 @@ function* concatLazy(iterables) {
20147
20149
  * per dynamic entry to marks all dynamic entry dependencies as "dirty" and put
20148
20150
  * them back into the iteration. As an additional optimization, we note for
20149
20151
  * each dynamic entry which dynamic dependent entries have changed and only
20150
- * intersect those entries again on subsequent interations.
20152
+ * intersect those entries again on subsequent iterations.
20151
20153
  *
20152
20154
  * Then we remove the dynamic entries from the list of dependent entries for
20153
20155
  * those chunks that are already loaded for that dynamic entry and create
@@ -23453,7 +23455,7 @@ function normalizeEntryModules(entryModules) {
23453
23455
  }));
23454
23456
  }
23455
23457
  class Graph {
23456
- constructor(options, watcher) {
23458
+ constructor(options, registerWatchHooks) {
23457
23459
  this.options = options;
23458
23460
  this.astLru = flru(5);
23459
23461
  this.cachedModules = new Map();
@@ -23488,12 +23490,12 @@ class Graph {
23488
23490
  value[0]++;
23489
23491
  }
23490
23492
  }
23491
- if (watcher) {
23493
+ if (registerWatchHooks) {
23492
23494
  this.watchMode = true;
23493
- const handleChange = (...parameters) => this.pluginDriver.hookParallel('watchChange', parameters);
23494
- const handleClose = () => this.pluginDriver.hookParallel('closeWatcher', []);
23495
- watcher.onCurrentRun('change', handleChange);
23496
- watcher.onCurrentRun('close', handleClose);
23495
+ registerWatchHooks({
23496
+ closeWatcher: () => this.pluginDriver.hookParallel('closeWatcher', []),
23497
+ watchChange: (...parameters) => this.pluginDriver.hookParallel('watchChange', parameters)
23498
+ });
23497
23499
  }
23498
23500
  this.pluginDriver = new PluginDriver(this, options, options.plugins, this.pluginCache);
23499
23501
  this.moduleLoader = new ModuleLoader(this, this.modulesById, this.options, this.pluginDriver);
@@ -24182,11 +24184,11 @@ Symbol.asyncDispose ??= Symbol('Symbol.asyncDispose');
24182
24184
  function rollup(rawInputOptions) {
24183
24185
  return rollupInternal(rawInputOptions, null);
24184
24186
  }
24185
- async function rollupInternal(rawInputOptions, watcher) {
24186
- const { options: inputOptions, unsetOptions: unsetInputOptions } = await getInputOptions(rawInputOptions, watcher !== null);
24187
+ async function rollupInternal(rawInputOptions, registerWatchHooks) {
24188
+ const { options: inputOptions, unsetOptions: unsetInputOptions } = await getInputOptions(rawInputOptions, registerWatchHooks !== null);
24187
24189
  initialiseTimers(inputOptions);
24188
24190
  await initWasm();
24189
- const graph = new Graph(inputOptions, watcher);
24191
+ const graph = new Graph(inputOptions, registerWatchHooks);
24190
24192
  // remove the cache object from the memory after graph creation (cache is not used anymore)
24191
24193
  const useCache = rawInputOptions.cache !== false;
24192
24194
  if (rawInputOptions.cache) {
@@ -24712,6 +24714,15 @@ const fseventsImporter = /*#__PURE__*/Object.defineProperty({
24712
24714
  loadFsEvents
24713
24715
  }, Symbol.toStringTag, { value: 'Module' });
24714
24716
 
24717
+ function waitForAllAndRethrowFirstFailure(promises) {
24718
+ return Promise.allSettled(promises).then(results => {
24719
+ for (const result of results) {
24720
+ if (result.status === 'rejected') {
24721
+ throw result.reason;
24722
+ }
24723
+ }
24724
+ });
24725
+ }
24715
24726
  class WatchEmitter {
24716
24727
  constructor() {
24717
24728
  this.currentHandlers = Object.create(null);
@@ -24720,7 +24731,8 @@ class WatchEmitter {
24720
24731
  // Will be overwritten by Rollup
24721
24732
  async close() { }
24722
24733
  emit(event, ...parameters) {
24723
- return Promise.all([...this.getCurrentHandlers(event), ...this.getPersistentHandlers(event)].map(handler => handler(...parameters)));
24734
+ // The async wrapper turns a synchronous throw into a rejection so that no sibling listener is skipped.
24735
+ return waitForAllAndRethrowFirstFailure([...this.getCurrentHandlers(event), ...this.getPersistentHandlers(event)].map(async (handler) => handler(...parameters)));
24724
24736
  }
24725
24737
  off(event, listener) {
24726
24738
  const listeners = this.persistentHandlers[event];
@@ -24767,7 +24779,21 @@ class WatchEmitter {
24767
24779
 
24768
24780
  function watch(configs) {
24769
24781
  const emitter = new WatchEmitter();
24770
- watchInternal(configs, emitter).catch(error => {
24782
+ let isClosed = false;
24783
+ // Until the watcher takes over closing, a close prevents its construction
24784
+ // and emits close itself, as no watcher will.
24785
+ emitter.close = async () => {
24786
+ if (isClosed)
24787
+ return;
24788
+ isClosed = true;
24789
+ try {
24790
+ await emitter.emit('close');
24791
+ }
24792
+ finally {
24793
+ emitter.removeAllListeners();
24794
+ }
24795
+ };
24796
+ watchInternal(configs, emitter, () => isClosed).catch(error => {
24771
24797
  handleError(error);
24772
24798
  });
24773
24799
  return emitter;
@@ -24799,7 +24825,7 @@ function checkWatchConfig(config) {
24799
24825
  }
24800
24826
  }
24801
24827
  }
24802
- async function watchInternal(configs, emitter) {
24828
+ async function watchInternal(configs, emitter, wasClosed) {
24803
24829
  const optionsList = await Promise.all(ensureArray(configs).map(config => mergeOptions(config, true)));
24804
24830
  const watchOptionsList = optionsList.filter(config => config.watch !== false);
24805
24831
  if (watchOptionsList.length === 0) {
@@ -24808,9 +24834,12 @@ async function watchInternal(configs, emitter) {
24808
24834
  checkWatchConfig(watchOptionsList);
24809
24835
  await loadFsEvents();
24810
24836
  const { Watcher } = await import('./watch.js');
24837
+ if (wasClosed()) {
24838
+ return;
24839
+ }
24811
24840
  new Watcher(watchOptionsList, emitter);
24812
24841
  }
24813
24842
 
24814
24843
  const VERSION = pkg.version;
24815
24844
 
24816
- export { VERSION, createFilter$1 as createFilter, defineConfig, fseventsImporter, getAugmentedNamespace, getDefaultExportFromCjs, rollup, rollupInternal, watch };
24845
+ export { VERSION, createFilter$1 as createFilter, defineConfig, fseventsImporter, getAugmentedNamespace, getDefaultExportFromCjs, rollup, rollupInternal, waitForAllAndRethrowFirstFailure, watch };
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.63.4
4
- Sat, 19 Sep 2026 06:35:38 GMT - commit ba78d5752a1e1ff4ff4af3a8bffab7691d822f7d
3
+ Rollup.js v4.63.5
4
+ Thu, 24 Sep 2026 10:07:23 GMT - commit 3722484c33c58b3ab0cbbfcca09b8f267d420329
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,13 +1,13 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.63.4
4
- Sat, 19 Sep 2026 06:35:38 GMT - commit ba78d5752a1e1ff4ff4af3a8bffab7691d822f7d
3
+ Rollup.js v4.63.5
4
+ Thu, 24 Sep 2026 10:07:23 GMT - commit 3722484c33c58b3ab0cbbfcca09b8f267d420329
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
8
8
  Released under the MIT License.
9
9
  */
10
- import { getAugmentedNamespace, fseventsImporter, getDefaultExportFromCjs, createFilter, rollupInternal } from './node-entry.js';
10
+ import { getAugmentedNamespace, fseventsImporter, getDefaultExportFromCjs, waitForAllAndRethrowFirstFailure, createFilter, rollupInternal } from './node-entry.js';
11
11
  import path from 'node:path';
12
12
  import process$1 from 'node:process';
13
13
  import require$$0$1 from 'path';
@@ -9690,11 +9690,12 @@ const eventsRewrites = {
9690
9690
  };
9691
9691
  class Watcher {
9692
9692
  constructor(optionsList, emitter) {
9693
+ this.closed = false;
9693
9694
  this.buildDelay = 0;
9694
9695
  this.buildTimeout = null;
9695
- this.closed = false;
9696
9696
  this.invalidatedIds = new Map();
9697
9697
  this.rerun = false;
9698
+ // Starts held so that invalidations before the initial run only request a rerun.
9698
9699
  this.running = true;
9699
9700
  this.emitter = emitter;
9700
9701
  emitter.close = this.close.bind(this);
@@ -9704,7 +9705,7 @@ class Watcher {
9704
9705
  this.buildDelay = Math.max(this.buildDelay, watch.buildDelay);
9705
9706
  }
9706
9707
  }
9707
- process$1.nextTick(() => this.run().catch(error => this.reportError(error)));
9708
+ process$1.nextTick(() => this.runExclusively(() => this.run()));
9708
9709
  }
9709
9710
  async close() {
9710
9711
  if (this.closed)
@@ -9712,13 +9713,19 @@ class Watcher {
9712
9713
  this.closed = true;
9713
9714
  if (this.buildTimeout)
9714
9715
  clearTimeout(this.buildTimeout);
9715
- for (const task of this.tasks) {
9716
- task.close();
9716
+ try {
9717
+ await waitForAllAndRethrowFirstFailure([
9718
+ ...this.tasks.map(task => task.close()),
9719
+ this.emitter.emit('close')
9720
+ ]);
9721
+ }
9722
+ finally {
9723
+ this.emitter.removeAllListeners();
9717
9724
  }
9718
- await this.emitter.emit('close');
9719
- this.emitter.removeAllListeners();
9720
9725
  }
9721
9726
  invalidate(file) {
9727
+ if (this.closed)
9728
+ return;
9722
9729
  if (file) {
9723
9730
  const previousEvent = this.invalidatedIds.get(file.id);
9724
9731
  const event = previousEvent ? eventsRewrites[previousEvent][file.event] : file.event;
@@ -9739,22 +9746,64 @@ class Watcher {
9739
9746
  }
9740
9747
  if (this.buildTimeout)
9741
9748
  clearTimeout(this.buildTimeout);
9742
- this.buildTimeout = setTimeout(async () => {
9749
+ this.buildTimeout = setTimeout(() => {
9743
9750
  this.buildTimeout = null;
9744
- try {
9745
- await Promise.all([...this.invalidatedIds].map(([id, event]) => this.emitter.emit('change', id, { event })));
9746
- this.invalidatedIds.clear();
9747
- await this.emitter.emit('restart');
9748
- this.emitter.removeListenersForCurrentRun();
9749
- await this.run();
9750
- }
9751
- catch (error) {
9752
- await this.reportError(error);
9753
- }
9751
+ this.runExclusively(() => this.announceChangesAndRebuild());
9754
9752
  }, this.buildDelay);
9755
9753
  }
9756
- async reportError(error) {
9754
+ // The running flag spans the whole cycle, including async listeners, so
9755
+ // that invalidations meanwhile only request a rerun.
9756
+ async runExclusively(cycle) {
9757
+ this.running = true;
9758
+ try {
9759
+ await cycle();
9760
+ }
9761
+ catch (error) {
9762
+ await this.reportError(error);
9763
+ }
9764
+ finally {
9765
+ this.running = false;
9766
+ }
9767
+ if (this.rerun) {
9768
+ this.rerun = false;
9769
+ this.invalidate();
9770
+ }
9771
+ }
9772
+ async announceChangesAndRebuild() {
9773
+ await this.announcePendingChanges();
9774
+ if (this.closed || !this.hasInvalidatedTask())
9775
+ return;
9776
+ await this.emitter.emit('restart');
9777
+ await this.announcePendingChanges();
9778
+ if (this.closed)
9779
+ return;
9780
+ this.emitter.removeListenersForCurrentRun();
9781
+ await this.run();
9782
+ }
9783
+ // The upcoming run consumes announced changes via the task flags, making
9784
+ // their rerun requests obsolete. The reset must directly follow the last
9785
+ // emptiness check so that no change slips through unannounced.
9786
+ async announcePendingChanges() {
9787
+ while (this.invalidatedIds.size > 0 && !this.closed) {
9788
+ await this.announceChangeBatch();
9789
+ }
9790
+ this.rerun = false;
9791
+ }
9792
+ // Cleared before emitting so that changes arriving during slow hooks,
9793
+ // including follow-ups of the same file, form the next batch instead of
9794
+ // being dropped with this one.
9795
+ async announceChangeBatch() {
9796
+ const changes = [...this.invalidatedIds];
9757
9797
  this.invalidatedIds.clear();
9798
+ await waitForAllAndRethrowFirstFailure(changes.flatMap(([id, event]) => [
9799
+ ...this.tasks.map(task => task.announceChange(id, event)),
9800
+ this.emitter.emit('change', id, { event })
9801
+ ]));
9802
+ }
9803
+ hasInvalidatedTask() {
9804
+ return this.tasks.some(task => task.isInvalidated());
9805
+ }
9806
+ async reportError(error) {
9758
9807
  await this.emitter.emit('event', {
9759
9808
  code: 'ERROR',
9760
9809
  error,
@@ -9765,37 +9814,26 @@ class Watcher {
9765
9814
  });
9766
9815
  }
9767
9816
  async run() {
9768
- this.running = true;
9769
- // Drop a rerun request left over from a failed run: honoring it after this run
9770
- // would start an empty run that removes the plugin event listeners of this run.
9771
- this.rerun = false;
9772
- try {
9773
- await this.emitter.emit('event', {
9774
- code: 'START'
9775
- });
9776
- for (const task of this.tasks) {
9777
- await task.run();
9778
- }
9779
- }
9780
- finally {
9781
- this.running = false;
9817
+ await this.emitter.emit('event', {
9818
+ code: 'START'
9819
+ });
9820
+ for (const task of this.tasks) {
9821
+ await task.run();
9782
9822
  }
9823
+ if (this.closed)
9824
+ return;
9783
9825
  await this.emitter.emit('event', {
9784
9826
  code: 'END'
9785
9827
  });
9786
- if (this.rerun) {
9787
- this.rerun = false;
9788
- this.invalidate();
9789
- }
9790
9828
  }
9791
9829
  }
9792
9830
  class Task {
9793
9831
  constructor(watcher, options) {
9794
9832
  this.cache = { modules: [] };
9795
9833
  this.watchFiles = [];
9796
- this.closed = false;
9797
9834
  this.invalidated = true;
9798
9835
  this.watched = new Set();
9836
+ this.watchHooks = null;
9799
9837
  this.watcher = watcher;
9800
9838
  this.options = options;
9801
9839
  this.skipWrite = Boolean(options.watch && options.watch.skipWrite);
@@ -9813,9 +9851,14 @@ class Task {
9813
9851
  ignoreInitial: true
9814
9852
  });
9815
9853
  }
9816
- close() {
9817
- this.closed = true;
9854
+ async announceChange(id, event) {
9855
+ await this.watchHooks?.watchChange(id, { event });
9856
+ }
9857
+ async close() {
9818
9858
  this.fileWatcher.close();
9859
+ const watchHooks = this.watchHooks;
9860
+ this.watchHooks = null;
9861
+ await watchHooks?.closeWatcher();
9819
9862
  }
9820
9863
  invalidate(id, details) {
9821
9864
  this.invalidated = true;
@@ -9830,8 +9873,11 @@ class Task {
9830
9873
  this.watcher.invalidate({ event: details.event, id });
9831
9874
  this.watchOptions.onInvalidate?.(id);
9832
9875
  }
9876
+ isInvalidated() {
9877
+ return this.invalidated;
9878
+ }
9833
9879
  async run() {
9834
- if (!this.invalidated)
9880
+ if (!this.invalidated || this.watcher.closed)
9835
9881
  return;
9836
9882
  this.invalidated = false;
9837
9883
  const options = {
@@ -9844,16 +9890,22 @@ class Task {
9844
9890
  input: this.options.input,
9845
9891
  output: this.outputFiles
9846
9892
  });
9893
+ if (this.watcher.closed) {
9894
+ return;
9895
+ }
9847
9896
  let result = null;
9848
9897
  try {
9849
- result = await rollupInternal(options, this.watcher.emitter);
9850
- if (this.closed) {
9898
+ result = await rollupInternal(options, watchHooks => {
9899
+ if (!this.watcher.closed)
9900
+ this.watchHooks = watchHooks;
9901
+ });
9902
+ if (this.watcher.closed) {
9851
9903
  return;
9852
9904
  }
9853
9905
  this.updateWatchedFiles(result);
9854
9906
  if (!this.skipWrite) {
9855
9907
  await Promise.all(this.outputs.map(output => result.write(output)));
9856
- if (this.closed) {
9908
+ if (this.watcher.closed) {
9857
9909
  return;
9858
9910
  }
9859
9911
  this.updateWatchedFiles(result);
@@ -9867,7 +9919,7 @@ class Task {
9867
9919
  });
9868
9920
  }
9869
9921
  catch (error) {
9870
- if (!this.closed) {
9922
+ if (!this.watcher.closed) {
9871
9923
  if (Array.isArray(error.watchFiles)) {
9872
9924
  for (const id of error.watchFiles) {
9873
9925
  this.watchFile(id);
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.63.4
4
- Sat, 19 Sep 2026 06:35:38 GMT - commit ba78d5752a1e1ff4ff4af3a8bffab7691d822f7d
3
+ Rollup.js v4.63.5
4
+ Thu, 24 Sep 2026 10:07:23 GMT - commit 3722484c33c58b3ab0cbbfcca09b8f267d420329
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.63.4
4
- Sat, 19 Sep 2026 06:35:38 GMT - commit ba78d5752a1e1ff4ff4af3a8bffab7691d822f7d
3
+ Rollup.js v4.63.5
4
+ Thu, 24 Sep 2026 10:07:23 GMT - commit 3722484c33c58b3ab0cbbfcca09b8f267d420329
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.63.4
4
- Sat, 19 Sep 2026 06:35:38 GMT - commit ba78d5752a1e1ff4ff4af3a8bffab7691d822f7d
3
+ Rollup.js v4.63.5
4
+ Thu, 24 Sep 2026 10:07:23 GMT - commit 3722484c33c58b3ab0cbbfcca09b8f267d420329
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
package/dist/rollup.d.ts CHANGED
@@ -1081,16 +1081,14 @@ export interface AwaitingEventEmitter<T extends Record<string, (...parameters: a
1081
1081
  off<K extends keyof T>(event: K, listener: AwaitedEventListener<T, K>): this;
1082
1082
  /**
1083
1083
  * Registers an event listener that will be awaited before Rollup continues.
1084
- * All listeners will be awaited in parallel while rejections are tracked via
1085
- * Promise.all.
1084
+ * All listeners are invoked and awaited in parallel. Rollup waits until all
1085
+ * of them have settled and then throws the first rejection, if any.
1086
1086
  */
1087
1087
  on<K extends keyof T>(event: K, listener: AwaitedEventListener<T, K>): this;
1088
1088
  /**
1089
- * Registers an event listener that will be awaited before Rollup continues.
1090
- * All listeners will be awaited in parallel while rejections are tracked via
1091
- * Promise.all.
1092
- * Listeners are removed automatically when removeListenersForCurrentRun is
1093
- * called, which happens automatically after each run.
1089
+ * Registers an event listener like `on`. Listeners are removed automatically
1090
+ * when removeListenersForCurrentRun is called, which happens right before each
1091
+ * rebuild, after the changes that triggered it were announced.
1094
1092
  */
1095
1093
  onCurrentRun<K extends keyof T>(
1096
1094
  event: K,
package/dist/rollup.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.63.4
4
- Sat, 19 Sep 2026 06:35:38 GMT - commit ba78d5752a1e1ff4ff4af3a8bffab7691d822f7d
3
+ Rollup.js v4.63.5
4
+ Thu, 24 Sep 2026 10:07:23 GMT - commit 3722484c33c58b3ab0cbbfcca09b8f267d420329
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -12,118 +12,20 @@
12
12
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
13
13
 
14
14
  const rollup = require('./shared/rollup.js');
15
- const parseAst_js = require('./shared/parseAst.js');
16
- const fseventsImporter = require('./shared/fsevents-importer.js');
17
- require('node:process');
15
+ const rollup_js = require('./shared/node-entry.js');
16
+ require('./shared/parseAst.js');
17
+ require('./native.js');
18
18
  require('node:path');
19
+ require('node:process');
19
20
  require('path');
20
- require('./native.js');
21
21
  require('node:perf_hooks');
22
22
  require('node:fs/promises');
23
+ require('./shared/fsevents-importer.js');
23
24
 
24
- class WatchEmitter {
25
- constructor() {
26
- this.currentHandlers = Object.create(null);
27
- this.persistentHandlers = Object.create(null);
28
- }
29
- // Will be overwritten by Rollup
30
- async close() { }
31
- emit(event, ...parameters) {
32
- return Promise.all([...this.getCurrentHandlers(event), ...this.getPersistentHandlers(event)].map(handler => handler(...parameters)));
33
- }
34
- off(event, listener) {
35
- const listeners = this.persistentHandlers[event];
36
- if (listeners) {
37
- // A hack stolen from "mitt": ">>> 0" does not change numbers >= 0, but -1
38
- // (which would remove the last array element if used unchanged) is turned
39
- // into max_int, which is outside the array and does not change anything.
40
- listeners.splice(listeners.indexOf(listener) >>> 0, 1);
41
- }
42
- return this;
43
- }
44
- on(event, listener) {
45
- this.getPersistentHandlers(event).push(listener);
46
- return this;
47
- }
48
- onCurrentRun(event, listener) {
49
- this.getCurrentHandlers(event).push(listener);
50
- return this;
51
- }
52
- once(event, listener) {
53
- const selfRemovingListener = (...parameters) => {
54
- this.off(event, selfRemovingListener);
55
- return listener(...parameters);
56
- };
57
- this.on(event, selfRemovingListener);
58
- return this;
59
- }
60
- removeAllListeners() {
61
- this.removeListenersForCurrentRun();
62
- this.persistentHandlers = Object.create(null);
63
- return this;
64
- }
65
- removeListenersForCurrentRun() {
66
- this.currentHandlers = Object.create(null);
67
- return this;
68
- }
69
- getCurrentHandlers(event) {
70
- return this.currentHandlers[event] || (this.currentHandlers[event] = []);
71
- }
72
- getPersistentHandlers(event) {
73
- return this.persistentHandlers[event] || (this.persistentHandlers[event] = []);
74
- }
75
- }
76
-
77
- function watch(configs) {
78
- const emitter = new WatchEmitter();
79
- watchInternal(configs, emitter).catch(error => {
80
- rollup.handleError(error);
81
- });
82
- return emitter;
83
- }
84
- function ensureTrailingSlash(path) {
85
- if (path[path.length - 1] !== '/') {
86
- return `${path}/`;
87
- }
88
- return path;
89
- }
90
- function checkWatchConfig(config) {
91
- for (const item of config) {
92
- if (typeof item.watch !== 'boolean' && item.watch?.allowInputInsideOutputPath) {
93
- break;
94
- }
95
- if (item.input && item.output) {
96
- const input = typeof item.input === 'string' ? rollup.ensureArray(item.input) : item.input;
97
- const outputs = rollup.ensureArray(item.output);
98
- for (const index in input) {
99
- const inputPath = input[index];
100
- if (typeof inputPath !== 'string') {
101
- continue;
102
- }
103
- const outputWithInputAsSubPath = outputs.find(({ dir }) => dir && ensureTrailingSlash(inputPath).startsWith(ensureTrailingSlash(dir)));
104
- if (outputWithInputAsSubPath) {
105
- parseAst_js.error(parseAst_js.logInvalidOption('watch', parseAst_js.URL_WATCH, `the input "${inputPath}" is a subpath of the output "${outputWithInputAsSubPath.dir}"`));
106
- }
107
- }
108
- }
109
- }
110
- }
111
- async function watchInternal(configs, emitter) {
112
- const optionsList = await Promise.all(rollup.ensureArray(configs).map(config => rollup.mergeOptions(config, true)));
113
- const watchOptionsList = optionsList.filter(config => config.watch !== false);
114
- if (watchOptionsList.length === 0) {
115
- return parseAst_js.error(parseAst_js.logInvalidOption('watch', parseAst_js.URL_WATCH, 'there must be at least one config where "watch" is not set to "false"'));
116
- }
117
- checkWatchConfig(watchOptionsList);
118
- await fseventsImporter.loadFsEvents();
119
- const { Watcher } = await Promise.resolve().then(() => require('./shared/watch.js'));
120
- new Watcher(watchOptionsList, emitter);
121
- }
122
25
 
123
- const VERSION = rollup.package_.version;
124
26
 
125
27
  exports.defineConfig = rollup.defineConfig;
126
28
  exports.rollup = rollup.rollup;
127
- exports.VERSION = VERSION;
128
- exports.watch = watch;
29
+ exports.VERSION = rollup_js.VERSION;
30
+ exports.watch = rollup_js.watch;
129
31
  //# sourceMappingURL=rollup.js.map
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.63.4
4
- Sat, 19 Sep 2026 06:35:38 GMT - commit ba78d5752a1e1ff4ff4af3a8bffab7691d822f7d
3
+ Rollup.js v4.63.5
4
+ Thu, 24 Sep 2026 10:07:23 GMT - commit 3722484c33c58b3ab0cbbfcca09b8f267d420329
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.63.4
4
- Sat, 19 Sep 2026 06:35:38 GMT - commit ba78d5752a1e1ff4ff4af3a8bffab7691d822f7d
3
+ Rollup.js v4.63.5
4
+ Thu, 24 Sep 2026 10:07:23 GMT - commit 3722484c33c58b3ab0cbbfcca09b8f267d420329
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.63.4
4
- Sat, 19 Sep 2026 06:35:38 GMT - commit ba78d5752a1e1ff4ff4af3a8bffab7691d822f7d
3
+ Rollup.js v4.63.5
4
+ Thu, 24 Sep 2026 10:07:23 GMT - commit 3722484c33c58b3ab0cbbfcca09b8f267d420329
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -0,0 +1,147 @@
1
+ /*
2
+ @license
3
+ Rollup.js v4.63.5
4
+ Thu, 24 Sep 2026 10:07:23 GMT - commit 3722484c33c58b3ab0cbbfcca09b8f267d420329
5
+
6
+ https://github.com/rollup/rollup
7
+
8
+ Released under the MIT License.
9
+ */
10
+ 'use strict';
11
+
12
+ const rollup = require('./rollup.js');
13
+ const parseAst_js = require('./parseAst.js');
14
+ const fseventsImporter = require('./fsevents-importer.js');
15
+
16
+ function waitForAllAndRethrowFirstFailure(promises) {
17
+ return Promise.allSettled(promises).then(results => {
18
+ for (const result of results) {
19
+ if (result.status === 'rejected') {
20
+ throw result.reason;
21
+ }
22
+ }
23
+ });
24
+ }
25
+ class WatchEmitter {
26
+ constructor() {
27
+ this.currentHandlers = Object.create(null);
28
+ this.persistentHandlers = Object.create(null);
29
+ }
30
+ // Will be overwritten by Rollup
31
+ async close() { }
32
+ emit(event, ...parameters) {
33
+ // The async wrapper turns a synchronous throw into a rejection so that no sibling listener is skipped.
34
+ return waitForAllAndRethrowFirstFailure([...this.getCurrentHandlers(event), ...this.getPersistentHandlers(event)].map(async (handler) => handler(...parameters)));
35
+ }
36
+ off(event, listener) {
37
+ const listeners = this.persistentHandlers[event];
38
+ if (listeners) {
39
+ // A hack stolen from "mitt": ">>> 0" does not change numbers >= 0, but -1
40
+ // (which would remove the last array element if used unchanged) is turned
41
+ // into max_int, which is outside the array and does not change anything.
42
+ listeners.splice(listeners.indexOf(listener) >>> 0, 1);
43
+ }
44
+ return this;
45
+ }
46
+ on(event, listener) {
47
+ this.getPersistentHandlers(event).push(listener);
48
+ return this;
49
+ }
50
+ onCurrentRun(event, listener) {
51
+ this.getCurrentHandlers(event).push(listener);
52
+ return this;
53
+ }
54
+ once(event, listener) {
55
+ const selfRemovingListener = (...parameters) => {
56
+ this.off(event, selfRemovingListener);
57
+ return listener(...parameters);
58
+ };
59
+ this.on(event, selfRemovingListener);
60
+ return this;
61
+ }
62
+ removeAllListeners() {
63
+ this.removeListenersForCurrentRun();
64
+ this.persistentHandlers = Object.create(null);
65
+ return this;
66
+ }
67
+ removeListenersForCurrentRun() {
68
+ this.currentHandlers = Object.create(null);
69
+ return this;
70
+ }
71
+ getCurrentHandlers(event) {
72
+ return this.currentHandlers[event] || (this.currentHandlers[event] = []);
73
+ }
74
+ getPersistentHandlers(event) {
75
+ return this.persistentHandlers[event] || (this.persistentHandlers[event] = []);
76
+ }
77
+ }
78
+
79
+ function watch(configs) {
80
+ const emitter = new WatchEmitter();
81
+ let isClosed = false;
82
+ // Until the watcher takes over closing, a close prevents its construction
83
+ // and emits close itself, as no watcher will.
84
+ emitter.close = async () => {
85
+ if (isClosed)
86
+ return;
87
+ isClosed = true;
88
+ try {
89
+ await emitter.emit('close');
90
+ }
91
+ finally {
92
+ emitter.removeAllListeners();
93
+ }
94
+ };
95
+ watchInternal(configs, emitter, () => isClosed).catch(error => {
96
+ rollup.handleError(error);
97
+ });
98
+ return emitter;
99
+ }
100
+ function ensureTrailingSlash(path) {
101
+ if (path[path.length - 1] !== '/') {
102
+ return `${path}/`;
103
+ }
104
+ return path;
105
+ }
106
+ function checkWatchConfig(config) {
107
+ for (const item of config) {
108
+ if (typeof item.watch !== 'boolean' && item.watch?.allowInputInsideOutputPath) {
109
+ break;
110
+ }
111
+ if (item.input && item.output) {
112
+ const input = typeof item.input === 'string' ? rollup.ensureArray(item.input) : item.input;
113
+ const outputs = rollup.ensureArray(item.output);
114
+ for (const index in input) {
115
+ const inputPath = input[index];
116
+ if (typeof inputPath !== 'string') {
117
+ continue;
118
+ }
119
+ const outputWithInputAsSubPath = outputs.find(({ dir }) => dir && ensureTrailingSlash(inputPath).startsWith(ensureTrailingSlash(dir)));
120
+ if (outputWithInputAsSubPath) {
121
+ parseAst_js.error(parseAst_js.logInvalidOption('watch', parseAst_js.URL_WATCH, `the input "${inputPath}" is a subpath of the output "${outputWithInputAsSubPath.dir}"`));
122
+ }
123
+ }
124
+ }
125
+ }
126
+ }
127
+ async function watchInternal(configs, emitter, wasClosed) {
128
+ const optionsList = await Promise.all(rollup.ensureArray(configs).map(config => rollup.mergeOptions(config, true)));
129
+ const watchOptionsList = optionsList.filter(config => config.watch !== false);
130
+ if (watchOptionsList.length === 0) {
131
+ return parseAst_js.error(parseAst_js.logInvalidOption('watch', parseAst_js.URL_WATCH, 'there must be at least one config where "watch" is not set to "false"'));
132
+ }
133
+ checkWatchConfig(watchOptionsList);
134
+ await fseventsImporter.loadFsEvents();
135
+ const { Watcher } = await Promise.resolve().then(() => require('./watch.js'));
136
+ if (wasClosed()) {
137
+ return;
138
+ }
139
+ new Watcher(watchOptionsList, emitter);
140
+ }
141
+
142
+ const VERSION = rollup.package_.version;
143
+
144
+ exports.VERSION = VERSION;
145
+ exports.waitForAllAndRethrowFirstFailure = waitForAllAndRethrowFirstFailure;
146
+ exports.watch = watch;
147
+ //# sourceMappingURL=node-entry.js.map
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.63.4
4
- Sat, 19 Sep 2026 06:35:38 GMT - commit ba78d5752a1e1ff4ff4af3a8bffab7691d822f7d
3
+ Rollup.js v4.63.5
4
+ Thu, 24 Sep 2026 10:07:23 GMT - commit 3722484c33c58b3ab0cbbfcca09b8f267d420329
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.63.4
4
- Sat, 19 Sep 2026 06:35:38 GMT - commit ba78d5752a1e1ff4ff4af3a8bffab7691d822f7d
3
+ Rollup.js v4.63.5
4
+ Thu, 24 Sep 2026 10:07:23 GMT - commit 3722484c33c58b3ab0cbbfcca09b8f267d420329
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.63.4";
45
+ var version = "4.63.5";
46
46
  const package_ = {
47
47
  version: version};
48
48
 
@@ -12845,6 +12845,8 @@ const builtinModules = [
12845
12845
  "assert/strict",
12846
12846
  "node:async_hooks",
12847
12847
  "async_hooks",
12848
+ "node:bench",
12849
+ "node:bench/reporters",
12848
12850
  "node:buffer",
12849
12851
  "buffer",
12850
12852
  "node:child_process",
@@ -21643,7 +21645,7 @@ function* concatLazy(iterables) {
21643
21645
  * per dynamic entry to marks all dynamic entry dependencies as "dirty" and put
21644
21646
  * them back into the iteration. As an additional optimization, we note for
21645
21647
  * each dynamic entry which dynamic dependent entries have changed and only
21646
- * intersect those entries again on subsequent interations.
21648
+ * intersect those entries again on subsequent iterations.
21647
21649
  *
21648
21650
  * Then we remove the dynamic entries from the list of dependent entries for
21649
21651
  * those chunks that are already loaded for that dynamic entry and create
@@ -23826,7 +23828,7 @@ function normalizeEntryModules(entryModules) {
23826
23828
  }));
23827
23829
  }
23828
23830
  class Graph {
23829
- constructor(options, watcher) {
23831
+ constructor(options, registerWatchHooks) {
23830
23832
  this.options = options;
23831
23833
  this.astLru = flru(5);
23832
23834
  this.cachedModules = new Map();
@@ -23861,12 +23863,12 @@ class Graph {
23861
23863
  value[0]++;
23862
23864
  }
23863
23865
  }
23864
- if (watcher) {
23866
+ if (registerWatchHooks) {
23865
23867
  this.watchMode = true;
23866
- const handleChange = (...parameters) => this.pluginDriver.hookParallel('watchChange', parameters);
23867
- const handleClose = () => this.pluginDriver.hookParallel('closeWatcher', []);
23868
- watcher.onCurrentRun('change', handleChange);
23869
- watcher.onCurrentRun('close', handleClose);
23868
+ registerWatchHooks({
23869
+ closeWatcher: () => this.pluginDriver.hookParallel('closeWatcher', []),
23870
+ watchChange: (...parameters) => this.pluginDriver.hookParallel('watchChange', parameters)
23871
+ });
23870
23872
  }
23871
23873
  this.pluginDriver = new PluginDriver(this, options, options.plugins, this.pluginCache);
23872
23874
  this.moduleLoader = new ModuleLoader(this, this.modulesById, this.options, this.pluginDriver);
@@ -24519,11 +24521,11 @@ Symbol.asyncDispose ??= Symbol('Symbol.asyncDispose');
24519
24521
  function rollup(rawInputOptions) {
24520
24522
  return rollupInternal(rawInputOptions, null);
24521
24523
  }
24522
- async function rollupInternal(rawInputOptions, watcher) {
24523
- const { options: inputOptions, unsetOptions: unsetInputOptions } = await getInputOptions(rawInputOptions, watcher !== null);
24524
+ async function rollupInternal(rawInputOptions, registerWatchHooks) {
24525
+ const { options: inputOptions, unsetOptions: unsetInputOptions } = await getInputOptions(rawInputOptions, registerWatchHooks !== null);
24524
24526
  initialiseTimers(inputOptions);
24525
24527
  await initWasm();
24526
- const graph = new Graph(inputOptions, watcher);
24528
+ const graph = new Graph(inputOptions, registerWatchHooks);
24527
24529
  // remove the cache object from the memory after graph creation (cache is not used anymore)
24528
24530
  const useCache = rawInputOptions.cache !== false;
24529
24531
  if (rawInputOptions.cache) {
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.63.4
4
- Sat, 19 Sep 2026 06:35:38 GMT - commit ba78d5752a1e1ff4ff4af3a8bffab7691d822f7d
3
+ Rollup.js v4.63.5
4
+ Thu, 24 Sep 2026 10:07:23 GMT - commit 3722484c33c58b3ab0cbbfcca09b8f267d420329
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -15,7 +15,7 @@ const index = require('./index.js');
15
15
  const promises = require('node:fs/promises');
16
16
  const process$2 = require('node:process');
17
17
  const cli = require('../bin/rollup');
18
- const rollup_js = require('../rollup.js');
18
+ const rollup_js = require('./node-entry.js');
19
19
  const rollup = require('./rollup.js');
20
20
  const parseAst_js = require('./parseAst.js');
21
21
  const loadConfigFile_js = require('./loadConfigFile.js');
@@ -520,13 +520,22 @@ async function watch(command) {
520
520
  }
521
521
  function close(code) {
522
522
  process$2.removeListener('uncaughtException', closeWithError);
523
- // removing a non-existent listener is a no-op
524
- process$2.stdin.removeListener('end', close);
525
523
  if (configWatcher)
526
524
  configWatcher.close();
527
- Promise.resolve(watcher?.close()).finally(() => {
528
- process$2.exit(typeof code === 'number' ? code : 0);
529
- });
525
+ Promise.resolve(watcher?.close())
526
+ .finally(() => {
527
+ // The numeric branch is only evaluated while the process is already exiting,
528
+ // after coverage tools have written their counters.
529
+ /* istanbul ignore next */
530
+ const exitCode = typeof code === 'number' ? code : 0;
531
+ process$2.exitCode = exitCode;
532
+ // Calling process.exit directly can deadlock while V8 background tasks are
533
+ // still running, see https://github.com/nodejs/node/issues/54918. Letting the
534
+ // process exit naturally avoids this, but plugins may keep handles open.
535
+ // The ".unref()" ensures this handler does not block exit
536
+ setTimeout(() => process$2.exit(exitCode), 200).unref();
537
+ })
538
+ .catch(error => rollup.handleError(error, true));
530
539
  // Tell signal-exit that we are handling this gracefully
531
540
  return true;
532
541
  }
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.63.4
4
- Sat, 19 Sep 2026 06:35:38 GMT - commit ba78d5752a1e1ff4ff4af3a8bffab7691d822f7d
3
+ Rollup.js v4.63.5
4
+ Thu, 24 Sep 2026 10:07:23 GMT - commit 3722484c33c58b3ab0cbbfcca09b8f267d420329
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -16,6 +16,7 @@ const path = require('node:path');
16
16
  const process = require('node:process');
17
17
  const index = require('./index.js');
18
18
  const node_os = require('node:os');
19
+ const rollup_js = require('./node-entry.js');
19
20
  require('./parseAst.js');
20
21
  require('../native.js');
21
22
  require('path');
@@ -103,11 +104,12 @@ const eventsRewrites = {
103
104
  };
104
105
  class Watcher {
105
106
  constructor(optionsList, emitter) {
107
+ this.closed = false;
106
108
  this.buildDelay = 0;
107
109
  this.buildTimeout = null;
108
- this.closed = false;
109
110
  this.invalidatedIds = new Map();
110
111
  this.rerun = false;
112
+ // Starts held so that invalidations before the initial run only request a rerun.
111
113
  this.running = true;
112
114
  this.emitter = emitter;
113
115
  emitter.close = this.close.bind(this);
@@ -117,7 +119,7 @@ class Watcher {
117
119
  this.buildDelay = Math.max(this.buildDelay, watch.buildDelay);
118
120
  }
119
121
  }
120
- process.nextTick(() => this.run().catch(error => this.reportError(error)));
122
+ process.nextTick(() => this.runExclusively(() => this.run()));
121
123
  }
122
124
  async close() {
123
125
  if (this.closed)
@@ -125,13 +127,19 @@ class Watcher {
125
127
  this.closed = true;
126
128
  if (this.buildTimeout)
127
129
  clearTimeout(this.buildTimeout);
128
- for (const task of this.tasks) {
129
- task.close();
130
+ try {
131
+ await rollup_js.waitForAllAndRethrowFirstFailure([
132
+ ...this.tasks.map(task => task.close()),
133
+ this.emitter.emit('close')
134
+ ]);
135
+ }
136
+ finally {
137
+ this.emitter.removeAllListeners();
130
138
  }
131
- await this.emitter.emit('close');
132
- this.emitter.removeAllListeners();
133
139
  }
134
140
  invalidate(file) {
141
+ if (this.closed)
142
+ return;
135
143
  if (file) {
136
144
  const previousEvent = this.invalidatedIds.get(file.id);
137
145
  const event = previousEvent ? eventsRewrites[previousEvent][file.event] : file.event;
@@ -152,22 +160,64 @@ class Watcher {
152
160
  }
153
161
  if (this.buildTimeout)
154
162
  clearTimeout(this.buildTimeout);
155
- this.buildTimeout = setTimeout(async () => {
163
+ this.buildTimeout = setTimeout(() => {
156
164
  this.buildTimeout = null;
157
- try {
158
- await Promise.all([...this.invalidatedIds].map(([id, event]) => this.emitter.emit('change', id, { event })));
159
- this.invalidatedIds.clear();
160
- await this.emitter.emit('restart');
161
- this.emitter.removeListenersForCurrentRun();
162
- await this.run();
163
- }
164
- catch (error) {
165
- await this.reportError(error);
166
- }
165
+ this.runExclusively(() => this.announceChangesAndRebuild());
167
166
  }, this.buildDelay);
168
167
  }
169
- async reportError(error) {
168
+ // The running flag spans the whole cycle, including async listeners, so
169
+ // that invalidations meanwhile only request a rerun.
170
+ async runExclusively(cycle) {
171
+ this.running = true;
172
+ try {
173
+ await cycle();
174
+ }
175
+ catch (error) {
176
+ await this.reportError(error);
177
+ }
178
+ finally {
179
+ this.running = false;
180
+ }
181
+ if (this.rerun) {
182
+ this.rerun = false;
183
+ this.invalidate();
184
+ }
185
+ }
186
+ async announceChangesAndRebuild() {
187
+ await this.announcePendingChanges();
188
+ if (this.closed || !this.hasInvalidatedTask())
189
+ return;
190
+ await this.emitter.emit('restart');
191
+ await this.announcePendingChanges();
192
+ if (this.closed)
193
+ return;
194
+ this.emitter.removeListenersForCurrentRun();
195
+ await this.run();
196
+ }
197
+ // The upcoming run consumes announced changes via the task flags, making
198
+ // their rerun requests obsolete. The reset must directly follow the last
199
+ // emptiness check so that no change slips through unannounced.
200
+ async announcePendingChanges() {
201
+ while (this.invalidatedIds.size > 0 && !this.closed) {
202
+ await this.announceChangeBatch();
203
+ }
204
+ this.rerun = false;
205
+ }
206
+ // Cleared before emitting so that changes arriving during slow hooks,
207
+ // including follow-ups of the same file, form the next batch instead of
208
+ // being dropped with this one.
209
+ async announceChangeBatch() {
210
+ const changes = [...this.invalidatedIds];
170
211
  this.invalidatedIds.clear();
212
+ await rollup_js.waitForAllAndRethrowFirstFailure(changes.flatMap(([id, event]) => [
213
+ ...this.tasks.map(task => task.announceChange(id, event)),
214
+ this.emitter.emit('change', id, { event })
215
+ ]));
216
+ }
217
+ hasInvalidatedTask() {
218
+ return this.tasks.some(task => task.isInvalidated());
219
+ }
220
+ async reportError(error) {
171
221
  await this.emitter.emit('event', {
172
222
  code: 'ERROR',
173
223
  error,
@@ -178,37 +228,26 @@ class Watcher {
178
228
  });
179
229
  }
180
230
  async run() {
181
- this.running = true;
182
- // Drop a rerun request left over from a failed run: honoring it after this run
183
- // would start an empty run that removes the plugin event listeners of this run.
184
- this.rerun = false;
185
- try {
186
- await this.emitter.emit('event', {
187
- code: 'START'
188
- });
189
- for (const task of this.tasks) {
190
- await task.run();
191
- }
192
- }
193
- finally {
194
- this.running = false;
231
+ await this.emitter.emit('event', {
232
+ code: 'START'
233
+ });
234
+ for (const task of this.tasks) {
235
+ await task.run();
195
236
  }
237
+ if (this.closed)
238
+ return;
196
239
  await this.emitter.emit('event', {
197
240
  code: 'END'
198
241
  });
199
- if (this.rerun) {
200
- this.rerun = false;
201
- this.invalidate();
202
- }
203
242
  }
204
243
  }
205
244
  class Task {
206
245
  constructor(watcher, options) {
207
246
  this.cache = { modules: [] };
208
247
  this.watchFiles = [];
209
- this.closed = false;
210
248
  this.invalidated = true;
211
249
  this.watched = new Set();
250
+ this.watchHooks = null;
212
251
  this.watcher = watcher;
213
252
  this.options = options;
214
253
  this.skipWrite = Boolean(options.watch && options.watch.skipWrite);
@@ -226,9 +265,14 @@ class Task {
226
265
  ignoreInitial: true
227
266
  });
228
267
  }
229
- close() {
230
- this.closed = true;
268
+ async announceChange(id, event) {
269
+ await this.watchHooks?.watchChange(id, { event });
270
+ }
271
+ async close() {
231
272
  this.fileWatcher.close();
273
+ const watchHooks = this.watchHooks;
274
+ this.watchHooks = null;
275
+ await watchHooks?.closeWatcher();
232
276
  }
233
277
  invalidate(id, details) {
234
278
  this.invalidated = true;
@@ -243,8 +287,11 @@ class Task {
243
287
  this.watcher.invalidate({ event: details.event, id });
244
288
  this.watchOptions.onInvalidate?.(id);
245
289
  }
290
+ isInvalidated() {
291
+ return this.invalidated;
292
+ }
246
293
  async run() {
247
- if (!this.invalidated)
294
+ if (!this.invalidated || this.watcher.closed)
248
295
  return;
249
296
  this.invalidated = false;
250
297
  const options = {
@@ -257,16 +304,22 @@ class Task {
257
304
  input: this.options.input,
258
305
  output: this.outputFiles
259
306
  });
307
+ if (this.watcher.closed) {
308
+ return;
309
+ }
260
310
  let result = null;
261
311
  try {
262
- result = await rollup.rollupInternal(options, this.watcher.emitter);
263
- if (this.closed) {
312
+ result = await rollup.rollupInternal(options, watchHooks => {
313
+ if (!this.watcher.closed)
314
+ this.watchHooks = watchHooks;
315
+ });
316
+ if (this.watcher.closed) {
264
317
  return;
265
318
  }
266
319
  this.updateWatchedFiles(result);
267
320
  if (!this.skipWrite) {
268
321
  await Promise.all(this.outputs.map(output => result.write(output)));
269
- if (this.closed) {
322
+ if (this.watcher.closed) {
270
323
  return;
271
324
  }
272
325
  this.updateWatchedFiles(result);
@@ -280,7 +333,7 @@ class Task {
280
333
  });
281
334
  }
282
335
  catch (error) {
283
- if (!this.closed) {
336
+ if (!this.watcher.closed) {
284
337
  if (Array.isArray(error.watchFiles)) {
285
338
  for (const id of error.watchFiles) {
286
339
  this.watchFile(id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rollup/wasm-node",
3
- "version": "4.63.4",
3
+ "version": "4.63.5",
4
4
  "description": "Next-generation ES module bundler with Node wasm",
5
5
  "main": "dist/rollup.js",
6
6
  "module": "dist/es/rollup.js",