@rollup/wasm-node 4.65.0 → 4.66.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin/rollup CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  /*
3
3
  @license
4
- Rollup.js v4.65.0
5
- Thu, 22 Oct 2026 08:51:29 GMT - commit 9aac09a39dc1fa297a7b06f1ad6907f7bd41b310
4
+ Rollup.js v4.66.0
5
+ Wed, 28 Oct 2026 13:27:47 GMT - commit 4de8104f55fe5c0df06aab54c1f9f2967dbe66ac
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.65.0\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.66.0\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.65.0
4
- Thu, 22 Oct 2026 08:51:29 GMT - commit 9aac09a39dc1fa297a7b06f1ad6907f7bd41b310
3
+ Rollup.js v4.66.0
4
+ Wed, 28 Oct 2026 13:27:47 GMT - commit 4de8104f55fe5c0df06aab54c1f9f2967dbe66ac
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.65.0
4
- Thu, 22 Oct 2026 08:51:29 GMT - commit 9aac09a39dc1fa297a7b06f1ad6907f7bd41b310
3
+ Rollup.js v4.66.0
4
+ Wed, 28 Oct 2026 13:27:47 GMT - commit 4de8104f55fe5c0df06aab54c1f9f2967dbe66ac
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.65.0
4
- Thu, 22 Oct 2026 08:51:29 GMT - commit 9aac09a39dc1fa297a7b06f1ad6907f7bd41b310
3
+ Rollup.js v4.66.0
4
+ Wed, 28 Oct 2026 13:27:47 GMT - commit 4de8104f55fe5c0df06aab54c1f9f2967dbe66ac
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -1,13 +1,13 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.65.0
4
- Thu, 22 Oct 2026 08:51:29 GMT - commit 9aac09a39dc1fa297a7b06f1ad6907f7bd41b310
3
+ Rollup.js v4.66.0
4
+ Wed, 28 Oct 2026 13:27:47 GMT - commit 4de8104f55fe5c0df06aab54c1f9f2967dbe66ac
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
8
8
  Released under the MIT License.
9
9
  */
10
- import { EMPTY_OBJECT, ExportDefaultDeclaration as ExportDefaultDeclaration$1, CallExpression as CallExpression$1, EMPTY_ARRAY, LOGLEVEL_WARN, logUnusedExternalImports, ANNOTATION_KEY, INVALID_ANNOTATION_KEY, ArrowFunctionExpression as ArrowFunctionExpression$1, FunctionExpression as FunctionExpression$1, Identifier as Identifier$1, ExpressionStatement as ExpressionStatement$1, AwaitExpression as AwaitExpression$1, MemberExpression as MemberExpression$1, ObjectExpression as ObjectExpression$1, Property as Property$1, Program as Program$1, logIllegalImportReassignment, BLANK, logRedeclarationError, StaticBlock as StaticBlock$1, CatchClause as CatchClause$1, logDuplicateArgumentNameError, logModuleLevelDirective, ReturnStatement as ReturnStatement$1, VariableDeclarator as VariableDeclarator$1, logMissingExport, normalize, getImportPath, error, logSourcePhaseFormatUnsupported, logMissingNodeBuiltins, logReservedNamespace, logIllegalIdentifierAsName, logMissingNameOptionForIifeExport, logMissingNameOptionForUmdExport, RestElement as RestElement$1, logConstVariableReassignError, EMPTY_SET, logCannotCallNamespace, logEval, BlockStatement as BlockStatement$1, getRollupError, logModuleParseError, logParseError, LOGLEVEL_INFO, logFirstSideEffect, locate, logInvalidAnnotation, logThisIsUndefined, getAstBuffer, convertAnnotations, FIXED_STRINGS, convertNode as convertNode$1, logImportAttributeIsInvalid, logImportOptionsAreInvalid, logMissingEntryExport, logSyntheticNamedExportsNeedNamespaceExport, logDuplicateExportError, logInvalidSourcemapForError, augmentCodeLocation, logInconsistentImportAttributes, logMissingJsxExport, logNamespaceConflict, logAmbiguousExternalNamespaces, logShimmedExport, parseAst, TemplateLiteral as TemplateLiteral$1, Literal as Literal$1, logCircularReexport, logInvalidFormatForTopLevelAwait, logAddonNotGenerated, logIncompatibleExportOptionValue, logMixedExport, logFailedValidation, isPathFragment, logCyclicCrossChunkReexport, getAliasName, logUnexpectedNamedImport, isAbsolute as isAbsolute$1, relative as relative$1, logUnexpectedNamespaceReexport, logEmptyChunk, logMissingGlobalName, logOptimizeChunkStatus, logSourcemapBroken, logConflictingSourcemapSources, logChunkInvalid, logInvalidOption, URL_OUTPUT_FORMAT, URL_OUTPUT_DIR, URL_OUTPUT_SOURCEMAPFILE, URL_OUTPUT_AMD_ID, logFileNameOutsideOutputDirectory, logCannotAssignModuleToChunk, logCircularChunk, logUnknownOption, printQuotedStringList, LOGLEVEL_ERROR, logLevelPriority, LOGLEVEL_DEBUG, logAnonymousPluginCache, logDuplicatePluginName, logInvalidSetAssetSourceCall, logPluginError, logNoTransformMapOrAstWithoutCode, warnDeprecation, URL_TRANSFORM, relativeId, logBadLoader, logNonExternalSourcePhaseImport, logInternalIdCannotBeExternal, isRelative, logUnresolvedImport, logUnresolvedImportTreatedAsExternal, logExternalSyntheticExports, logUnresolvedEntry, logUnresolvedImplicitDependant, logExternalModulesCannotBeIncludedInManualChunks, logEntryCannotBeExternal, logImplicitDependantCannotBeExternal, logExternalModulesCannotBeTransformedToModules, URL_LOAD, logNoAssetSourceSet, logFileReferenceIdNotFoundForFilename, logAssetReferenceIdNotFoundForSetSource, logAssetSourceAlreadySet, logInvalidRollupPhaseForChunkEmission, logChunkNotGeneratedForFileName, logAssetNotFinalisedForFileName, logFileNameConflict, URL_GENERATEBUNDLE, logInvalidLogPosition, logInputHookInOutputPlugin, logInvalidAddonPluginHook, logInvalidFunctionPluginHook, logImplicitDependantIsNotIncluded, logCircularDependency, augmentLogMessage, URL_JSX, URL_TREESHAKE, URL_TREESHAKE_MODULESIDEEFFECTS, URL_OUTPUT_INLINEDYNAMICIMPORTS, URL_PRESERVEENTRYSIGNATURES, URL_OUTPUT_GENERATEDCODE, isValidUrl, addTrailingSlashIfMissed, URL_OUTPUT_SOURCEMAPBASEURL, URL_OUTPUT_MANUALCHUNKS, logInvalidExportOptionValue, URL_OUTPUT_AMD_BASEPATH, URL_OUTPUT_INTEROP, URL_OUTPUT_EXTERNALIMPORTATTRIBUTES, logAlreadyClosed, logMissingFileOrDirOption, logCannotEmitFromOptionsHook, URL_WATCH } from './parseAst.js';
10
+ import { EMPTY_OBJECT, ExportDefaultDeclaration as ExportDefaultDeclaration$1, CallExpression as CallExpression$1, EMPTY_ARRAY, LOGLEVEL_WARN, logUnusedExternalImports, ANNOTATION_KEY, INVALID_ANNOTATION_KEY, ArrowFunctionExpression as ArrowFunctionExpression$1, FunctionExpression as FunctionExpression$1, Identifier as Identifier$1, ExpressionStatement as ExpressionStatement$1, AwaitExpression as AwaitExpression$1, MemberExpression as MemberExpression$1, ObjectExpression as ObjectExpression$1, Property as Property$1, Program as Program$1, logIllegalImportReassignment, BLANK, logRedeclarationError, StaticBlock as StaticBlock$1, CatchClause as CatchClause$1, logDuplicateArgumentNameError, logModuleLevelDirective, ReturnStatement as ReturnStatement$1, VariableDeclarator as VariableDeclarator$1, logMissingExport, normalize, getImportPath, error, logSourcePhaseFormatUnsupported, logMissingNodeBuiltins, logReservedNamespace, logIllegalIdentifierAsName, logMissingNameOptionForIifeExport, logMissingNameOptionForUmdExport, RestElement as RestElement$1, logConstVariableReassignError, EMPTY_SET, logCannotCallNamespace, logEval, BlockStatement as BlockStatement$1, getRollupError, logModuleParseError, logParseError, LOGLEVEL_INFO, logFirstSideEffect, locate, logInvalidAnnotation, logThisIsUndefined, getAstBuffer, convertAnnotations, FIXED_STRINGS, convertNode as convertNode$1, isAbsolute as isAbsolute$1, logImportAttributeIsInvalid, logImportOptionsAreInvalid, logMissingEntryExport, logSyntheticNamedExportsNeedNamespaceExport, logDuplicateExportError, logInvalidSourcemapForError, augmentCodeLocation, logInconsistentImportAttributes, logMissingJsxExport, logNamespaceConflict, logAmbiguousExternalNamespaces, logShimmedExport, parseAst, TemplateLiteral as TemplateLiteral$1, Literal as Literal$1, logCircularReexport, logInvalidFormatForTopLevelAwait, logAddonNotGenerated, logIncompatibleExportOptionValue, logMixedExport, logFailedValidation, isPathFragment, logCyclicCrossChunkReexport, getAliasName, logUnexpectedNamedImport, relative as relative$1, logUnexpectedNamespaceReexport, logEmptyChunk, logMissingGlobalName, logOptimizeChunkStatus, logSourcemapBroken, logConflictingSourcemapSources, logErrorInHook, logChunkInvalid, logInvalidOption, URL_OUTPUT_FORMAT, URL_OUTPUT_DIR, URL_OUTPUT_SOURCEMAPFILE, URL_OUTPUT_AMD_ID, logFileNameOutsideOutputDirectory, logCannotAssignModuleToChunk, logCircularChunk, logUnknownOption, printQuotedStringList, LOGLEVEL_ERROR, logLevelPriority, LOGLEVEL_DEBUG, logAnonymousPluginCache, logDuplicatePluginName, logInvalidSetAssetSourceCall, logPluginError, logNoTransformMapOrAstWithoutCode, warnDeprecation, URL_TRANSFORM, relativeId, logBadLoader, logNonExternalSourcePhaseImport, logInternalIdCannotBeExternal, isRelative, logUnresolvedImport, logUnresolvedImportTreatedAsExternal, logExternalSyntheticExports, logUnresolvedEntry, logUnresolvedImplicitDependant, logExternalModulesCannotBeIncludedInManualChunks, logEntryCannotBeExternal, logImplicitDependantCannotBeExternal, logExternalModulesCannotBeTransformedToModules, URL_LOAD, logNoAssetSourceSet, logFileReferenceIdNotFoundForFilename, logAssetReferenceIdNotFoundForSetSource, logAssetSourceAlreadySet, logInvalidRollupPhaseForChunkEmission, logChunkNotGeneratedForFileName, logAssetNotFinalisedForFileName, logFileNameConflict, URL_GENERATEBUNDLE, logInvalidLogPosition, logInputHookInOutputPlugin, logInvalidAddonPluginHook, logInvalidFunctionPluginHook, logImplicitDependantIsNotIncluded, logCircularDependency, augmentLogMessage, URL_JSX, URL_TREESHAKE, URL_TREESHAKE_MODULESIDEEFFECTS, URL_OUTPUT_INLINEDYNAMICIMPORTS, URL_PRESERVEENTRYSIGNATURES, URL_OUTPUT_GENERATEDCODE, isValidUrl, addTrailingSlashIfMissed, URL_OUTPUT_SOURCEMAPBASEURL, URL_OUTPUT_MANUALCHUNKS, logInvalidExportOptionValue, URL_OUTPUT_AMD_BASEPATH, URL_OUTPUT_INTEROP, URL_OUTPUT_EXTERNALIMPORTATTRIBUTES, logAlreadyClosed, logMissingFileOrDirOption, logCannotEmitFromOptionsHook, URL_WATCH } from './parseAst.js';
11
11
  import { relative, dirname, basename, extname, resolve as resolve$1, join } from 'node:path';
12
12
  import { posix, isAbsolute, resolve, win32 } from 'path';
13
13
  import { parseAsync, xxhashBase16, xxhashBase64Url, xxhashBase36 } from '../../native.js';
@@ -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.65.0";
30
+ var version = "4.66.0";
31
31
  const pkg = {
32
32
  version: version};
33
33
 
@@ -2214,8 +2214,8 @@ const UnknownNonAccessorKey = Symbol('Unknown Non-Accessor Key');
2214
2214
  const UnknownInteger = Symbol('Unknown Integer');
2215
2215
  const UnknownWellKnown = Symbol('Unknown Well-Known');
2216
2216
  const SymbolToStringTag = Symbol('Symbol.toStringTag');
2217
- const SymbolDispose = Symbol('Symbol.asyncDispose');
2218
- const SymbolAsyncDispose = Symbol('Symbol.dispose');
2217
+ const SymbolDispose = Symbol('Symbol.dispose');
2218
+ const SymbolAsyncDispose = Symbol('Symbol.asyncDispose');
2219
2219
  const SymbolHasInstance = Symbol('Symbol.hasInstance');
2220
2220
  const WELL_KNOWN_SYMBOLS_LIST = [
2221
2221
  SymbolToStringTag,
@@ -2322,6 +2322,25 @@ class IncludedFullPathTracker {
2322
2322
  }
2323
2323
  return included;
2324
2324
  }
2325
+ includeAllPaths(entity, context, basePath) {
2326
+ if (this.includedPaths) {
2327
+ includeAllSubPaths(entity, context, basePath, this.includedPaths);
2328
+ }
2329
+ }
2330
+ }
2331
+ function includeAllSubPaths(entity, context, path, includedPaths) {
2332
+ if (includedPaths[UnknownKey]) {
2333
+ entity.includePath([...path, UnknownKey], context);
2334
+ return;
2335
+ }
2336
+ const keys = Reflect.ownKeys(includedPaths);
2337
+ if (keys.length === 0) {
2338
+ entity.includePath(path, context);
2339
+ return;
2340
+ }
2341
+ for (const key of keys) {
2342
+ includeAllSubPaths(entity, context, [...path, key], includedPaths[key]);
2343
+ }
2325
2344
  }
2326
2345
  const UNKNOWN_INCLUDED_TOP_LEVEL_PATH = Object.freeze({
2327
2346
  [UnknownKey]: true
@@ -2365,13 +2384,15 @@ class IncludedTopLevelPathTracker {
2365
2384
  entity.includePath([...basePath, UnknownKey], context);
2366
2385
  }
2367
2386
  else {
2368
- const inclusionEntries = Object.entries(includedPaths);
2369
- if (inclusionEntries.length === 0) {
2387
+ const keys = Reflect.ownKeys(includedPaths);
2388
+ if (keys.length === 0) {
2370
2389
  entity.includePath(basePath, context);
2371
2390
  }
2372
2391
  else {
2373
- for (const [key, value] of inclusionEntries) {
2374
- entity.includePath(value === UnknownKey ? [...basePath, key, UnknownKey] : [...basePath, key], context);
2392
+ for (const key of keys) {
2393
+ entity.includePath(includedPaths[key] === UnknownKey
2394
+ ? [...basePath, key, UnknownKey]
2395
+ : [...basePath, key], context);
2375
2396
  }
2376
2397
  }
2377
2398
  }
@@ -2485,6 +2506,9 @@ class ExpressionEntity {
2485
2506
  deoptimizeInteraction(interaction);
2486
2507
  }
2487
2508
  deoptimizePath(_path) { }
2509
+ getKnownFunctionAtPath(_path, _recursionTracker, _origin) {
2510
+ return null;
2511
+ }
2488
2512
  /**
2489
2513
  * If possible it returns a stringifyable literal value for this node that
2490
2514
  * can be used for inlining or comparing values. Otherwise, it should return
@@ -3740,6 +3764,17 @@ class ObjectEntity extends ExpressionEntity {
3740
3764
  }
3741
3765
  this.prototypeExpression?.deoptimizePath(path.length === 1 ? [path[0], UnknownKey] : path);
3742
3766
  }
3767
+ getKnownFunctionAtPath(path, recursionTracker, origin) {
3768
+ const key = path[0];
3769
+ // Setters can shadow data properties or inherited methods without appearing in the getter map.
3770
+ if (!isConcreteKey(key) || this.settersByKey.has(key) || this.unmatchableSetters.length > 0) {
3771
+ return null;
3772
+ }
3773
+ const expressionAtPath = this.getMemberExpressionAndTrackDeopt(key, origin);
3774
+ return expressionAtPath
3775
+ ? expressionAtPath.getKnownFunctionAtPath(path.slice(1), recursionTracker, origin)
3776
+ : this.prototypeExpression?.getKnownFunctionAtPath(path, recursionTracker, origin) || null;
3777
+ }
3743
3778
  getLiteralValueAtPath(path, recursionTracker, origin) {
3744
3779
  if (path.length === 0) {
3745
3780
  // This should actually be "UnknownTruthyValue". However, this currently
@@ -3996,22 +4031,25 @@ class ObjectEntity extends ExpressionEntity {
3996
4031
  }
3997
4032
  }
3998
4033
 
3999
- const isInteger = (property) => typeof property === 'string' && /^\d+$/.test(property);
4034
+ const isKnownToBeMissing = (property) => property === SymbolDispose ||
4035
+ property === SymbolAsyncDispose ||
4036
+ (typeof property === 'string' && /^\d+$/.test(property));
4000
4037
  // This makes sure unknown properties are not handled as "undefined" but as
4001
4038
  // "unknown" but without access side effects. An exception is done for numeric
4002
4039
  // properties as we do not expect new builtin properties to be numbers, this
4003
- // will improve tree-shaking for out-of-bounds array properties
4040
+ // will improve tree-shaking for out-of-bounds array properties. Disposal
4041
+ // methods are also known to be missing so that "await using" can rely on the
4042
+ // fallback to Symbol.dispose for plain objects.
4004
4043
  const OBJECT_PROTOTYPE_FALLBACK = new (class ObjectPrototypeFallbackExpression extends ExpressionEntity {
4005
4044
  deoptimizeArgumentsOnInteractionAtPath(interaction, path) {
4006
- if (interaction.type === INTERACTION_CALLED && path.length === 1 && !isInteger(path[0])) {
4045
+ if (interaction.type === INTERACTION_CALLED &&
4046
+ path.length === 1 &&
4047
+ !isKnownToBeMissing(path[0])) {
4007
4048
  deoptimizeInteraction(interaction);
4008
4049
  }
4009
4050
  }
4010
4051
  getLiteralValueAtPath(path) {
4011
- // We ignore number properties as we do not expect new properties to be
4012
- // numbers and also want to keep handling out-of-bound array elements as
4013
- // "undefined"
4014
- return path.length === 1 && isInteger(path[0]) ? undefined : UnknownValue;
4052
+ return path.length === 1 && isKnownToBeMissing(path[0]) ? undefined : UnknownValue;
4015
4053
  }
4016
4054
  hasEffectsOnInteractionAtPath(path, { type }) {
4017
4055
  return path.length > 1 || type === INTERACTION_CALLED;
@@ -4025,6 +4063,9 @@ const OBJECT_PROTOTYPE = new ObjectEntity(new Map([
4025
4063
  ['toString', METHOD_RETURNS_STRING],
4026
4064
  ['valueOf', METHOD_RETURNS_UNKNOWN]
4027
4065
  ]), OBJECT_PROTOTYPE_FALLBACK, true);
4066
+ // Generator prototypes inherit disposal methods from the iterator prototypes
4067
+ const GENERATOR_PROTOTYPE = new ObjectEntity([{ key: SymbolDispose, kind: 'init', property: UNKNOWN_EXPRESSION }], OBJECT_PROTOTYPE, true);
4068
+ const ASYNC_GENERATOR_PROTOTYPE = new ObjectEntity([{ key: SymbolAsyncDispose, kind: 'init', property: UNKNOWN_EXPRESSION }], OBJECT_PROTOTYPE, true);
4028
4069
 
4029
4070
  const NEW_ARRAY_PROPERTIES = [
4030
4071
  { key: UnknownInteger, kind: 'init', property: UNKNOWN_EXPRESSION },
@@ -4169,7 +4210,8 @@ const ARRAY_PROTOTYPE = new ObjectEntity(new Map([
4169
4210
 
4170
4211
  class SpreadElement extends NodeBase {
4171
4212
  deoptimizeArgumentsOnInteractionAtPath(interaction, path, recursionTracker) {
4172
- if (path.length > 0) {
4213
+ // Spread values are copied as data properties, so only calling them can still reach the argument
4214
+ if (path.length > 0 || interaction.type === INTERACTION_CALLED) {
4173
4215
  this.argument.deoptimizeArgumentsOnInteractionAtPath(interaction, UNKNOWN_PATH, recursionTracker);
4174
4216
  }
4175
4217
  }
@@ -5389,6 +5431,15 @@ class LocalVariable extends Variable {
5389
5431
  this.init.deoptimizePath(limitConcatenatedPathDepth(this.initPath, path));
5390
5432
  }
5391
5433
  }
5434
+ getKnownFunctionAtPath(path, recursionTracker, origin) {
5435
+ if (this.isReassigned || path.length + this.initPath.length > MAX_PATH_DEPTH) {
5436
+ return null;
5437
+ }
5438
+ return recursionTracker.withTrackedEntityAtPath(path, this.init, () => {
5439
+ this.expressionsToBeDeoptimized.push(origin);
5440
+ return this.init.getKnownFunctionAtPath([...this.initPath, ...path], recursionTracker, origin);
5441
+ }, null);
5442
+ }
5392
5443
  getLiteralValueAtPath(path, recursionTracker, origin) {
5393
5444
  if (this.isReassigned || path.length + this.initPath.length > MAX_PATH_DEPTH) {
5394
5445
  return UnknownValue;
@@ -5548,6 +5599,9 @@ class IdentifierBase extends NodeBase {
5548
5599
  // Identifier as property that might be deoptimized by default
5549
5600
  this.variable?.deoptimizePath(path);
5550
5601
  }
5602
+ getKnownFunctionAtPath(path, recursionTracker, origin) {
5603
+ return this.getVariableRespectingTDZ().getKnownFunctionAtPath(path, recursionTracker, origin);
5604
+ }
5551
5605
  getLiteralValueAtPath(path, recursionTracker, origin) {
5552
5606
  return this.getVariableRespectingTDZ().getLiteralValueAtPath(path, recursionTracker, origin);
5553
5607
  }
@@ -6027,6 +6081,11 @@ class MethodBase extends NodeBase {
6027
6081
  deoptimizePath(path) {
6028
6082
  this.getAccessedValue()[0].deoptimizePath(path);
6029
6083
  }
6084
+ getKnownFunctionAtPath(path, recursionTracker, origin) {
6085
+ return this.kind === 'get' || this.kind === 'set'
6086
+ ? null
6087
+ : this.value.getKnownFunctionAtPath(path, recursionTracker, origin);
6088
+ }
6030
6089
  getLiteralValueAtPath(path, recursionTracker, origin) {
6031
6090
  return this.getAccessedValue()[0].getLiteralValueAtPath(path, recursionTracker, origin);
6032
6091
  }
@@ -6608,6 +6667,8 @@ class ParameterVariable extends LocalVariable {
6608
6667
  class ThisVariable extends ParameterVariable {
6609
6668
  constructor(context) {
6610
6669
  super('this', null, EMPTY_PATH, context);
6670
+ // Unlike parameters, track nested paths so receivers only keep what is accessed via "this"
6671
+ this.includedPathTracker = new IncludedFullPathTracker();
6611
6672
  }
6612
6673
  hasEffectsOnInteractionAtPath(path, interaction, context) {
6613
6674
  return (context.replacedVariableInits.get(this) || UNKNOWN_EXPRESSION).hasEffectsOnInteractionAtPath(path, interaction, context);
@@ -6912,8 +6973,11 @@ class FunctionScope extends ReturnValueScope {
6912
6973
  }
6913
6974
  includeCallArguments(interaction, context) {
6914
6975
  super.includeCallArguments(interaction, context);
6976
+ const { args } = interaction;
6977
+ if (args[0]) {
6978
+ this.thisVariable.includeArgumentPaths(args[0], context);
6979
+ }
6915
6980
  if (this.argumentsVariable.included) {
6916
- const { args } = interaction;
6917
6981
  for (let argumentIndex = 1; argumentIndex < args.length; argumentIndex++) {
6918
6982
  const argument = args[argumentIndex];
6919
6983
  if (argument) {
@@ -7130,6 +7194,11 @@ class FunctionBase extends NodeBase {
7130
7194
  this.scope.deoptimizeAllParameters();
7131
7195
  }
7132
7196
  }
7197
+ getKnownFunctionAtPath(path, recursionTracker, origin) {
7198
+ return path.length === 0
7199
+ ? this
7200
+ : this.getObjectEntity().getKnownFunctionAtPath(path, recursionTracker, origin);
7201
+ }
7133
7202
  getLiteralValueAtPath(path, recursionTracker, origin) {
7134
7203
  return this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin);
7135
7204
  }
@@ -7137,7 +7206,7 @@ class FunctionBase extends NodeBase {
7137
7206
  if (path.length > 0) {
7138
7207
  return this.getObjectEntity().getReturnExpressionWhenCalledAtPath(path, interaction, recursionTracker, origin);
7139
7208
  }
7140
- if (this.async) {
7209
+ if (this.async || this.generator) {
7141
7210
  if (!this.deoptimizedReturn) {
7142
7211
  this.deoptimizedReturn = true;
7143
7212
  this.scope.getReturnExpression().deoptimizePath(UNKNOWN_PATH);
@@ -7333,10 +7402,15 @@ class FunctionNode extends FunctionBase {
7333
7402
  {
7334
7403
  key: 'prototype',
7335
7404
  kind: 'init',
7336
- property: new ObjectEntity([], OBJECT_PROTOTYPE)
7405
+ property: new ObjectEntity([], this.getPrototypeOfPrototype())
7337
7406
  }
7338
7407
  ], OBJECT_PROTOTYPE));
7339
7408
  }
7409
+ getPrototypeOfPrototype() {
7410
+ if (!this.generator)
7411
+ return OBJECT_PROTOTYPE;
7412
+ return this.async ? ASYNC_GENERATOR_PROTOTYPE : GENERATOR_PROTOTYPE;
7413
+ }
7340
7414
  }
7341
7415
 
7342
7416
  class FunctionDeclaration extends FunctionNode {
@@ -7900,6 +7974,20 @@ class MemberExpression extends NodeBase {
7900
7974
  ]);
7901
7975
  }
7902
7976
  }
7977
+ getKnownFunctionAtPath(path, recursionTracker, origin) {
7978
+ if (this.variable) {
7979
+ return this.variable.getKnownFunctionAtPath(path, recursionTracker, origin);
7980
+ }
7981
+ if (this.isUndefined)
7982
+ return null;
7983
+ const propertyKey = this.getDynamicPropertyKey();
7984
+ if (propertyKey !== UnknownKey && path.length < MAX_PATH_DEPTH) {
7985
+ if (propertyKey !== this.propertyKey)
7986
+ this.expressionsToBeDeoptimized.push(origin);
7987
+ return this.object.getKnownFunctionAtPath([propertyKey, ...path], recursionTracker, origin);
7988
+ }
7989
+ return null;
7990
+ }
7903
7991
  getLiteralValueAtPath(path, recursionTracker, origin) {
7904
7992
  if (this.variable) {
7905
7993
  return this.variable.getLiteralValueAtPath(path, recursionTracker, origin);
@@ -15257,6 +15345,9 @@ class ObjectExpression extends NodeBase {
15257
15345
  deoptimizePath(path) {
15258
15346
  this.getObjectEntity().deoptimizePath(path);
15259
15347
  }
15348
+ getKnownFunctionAtPath(path, recursionTracker, origin) {
15349
+ return this.getObjectEntity().getKnownFunctionAtPath(path, recursionTracker, origin);
15350
+ }
15260
15351
  getLiteralValueAtPath(path, recursionTracker, origin) {
15261
15352
  return this.getObjectEntity().getLiteralValueAtPath(path, recursionTracker, origin);
15262
15353
  }
@@ -16425,6 +16516,14 @@ class VariableDeclarator extends NodeBase {
16425
16516
  deoptimizePath(path) {
16426
16517
  this.id.deoptimizePath(path);
16427
16518
  }
16519
+ deoptimizeCache() {
16520
+ if (!this.hasDeoptimizedDisposal && this.init) {
16521
+ this.hasDeoptimizedDisposal = true;
16522
+ this.init.deoptimizePath(UNKNOWN_PATH);
16523
+ this.init.includePath(UNKNOWN_PATH, createInclusionContext());
16524
+ this.scope.context.requestTreeshakingPass();
16525
+ }
16526
+ }
16428
16527
  hasEffects(context) {
16429
16528
  const initEffect = this.init?.hasEffects(context);
16430
16529
  this.id.markDeclarationReached();
@@ -16440,6 +16539,11 @@ class VariableDeclarator extends NodeBase {
16440
16539
  const { id, init } = this;
16441
16540
  if (!this.included)
16442
16541
  this.includeNode(context);
16542
+ const { disposalCall, disposalFunction } = this;
16543
+ // Before including init so that newly included receiver paths are included in this pass
16544
+ if (disposalFunction && disposalCall) {
16545
+ disposalFunction.includeCallArgumentsWhenCalledAtPath(EMPTY_PATH, disposalCall, context);
16546
+ }
16443
16547
  init?.include(context, includeChildrenRecursively);
16444
16548
  id.markDeclarationReached();
16445
16549
  if (includeChildrenRecursively) {
@@ -16481,11 +16585,16 @@ class VariableDeclarator extends NodeBase {
16481
16585
  this.included = true;
16482
16586
  const { id, init } = this;
16483
16587
  if (init) {
16484
- if (this.isUsingDeclaration) {
16485
- init.includePath(SYMBOL_DISPOSE_PATH, context);
16486
- }
16487
- else if (this.isAsyncUsingDeclaration) {
16488
- init.includePath(SYMBOL_ASYNC_DISPOSE_PATH, context);
16588
+ if (this.isUsingDeclaration || this.isAsyncUsingDeclaration) {
16589
+ const disposalInteractions = {
16590
+ access: { args: [init], type: INTERACTION_ACCESSED },
16591
+ call: { args: [init], type: INTERACTION_CALLED, withNew: false }
16592
+ };
16593
+ if (this.isUsingDeclaration ||
16594
+ !this.includeDisposalMethodAndCheckIfKnownFunction(init, SYMBOL_ASYNC_DISPOSE_PATH, disposalInteractions, context)) {
16595
+ this.includeDisposalMethodAndCheckIfKnownFunction(init, SYMBOL_DISPOSE_PATH, disposalInteractions, context);
16596
+ }
16597
+ this.scope.context.requestTreeshakingPass();
16489
16598
  }
16490
16599
  if (id instanceof Identifier && init instanceof ClassExpression && !init.id) {
16491
16600
  const { name, variable } = id;
@@ -16497,6 +16606,23 @@ class VariableDeclarator extends NodeBase {
16497
16606
  }
16498
16607
  }
16499
16608
  }
16609
+ includeDisposalMethodAndCheckIfKnownFunction(init, path, { access, call }, context) {
16610
+ init.deoptimizeArgumentsOnInteractionAtPath(access, path, SHARED_RECURSION_TRACKER);
16611
+ const disposalFunction = init.getKnownFunctionAtPath(path, SHARED_RECURSION_TRACKER, this);
16612
+ init.includePath(path, context);
16613
+ if (!disposalFunction) {
16614
+ const disposalValue = init.getLiteralValueAtPath(path, SHARED_RECURSION_TRACKER, this);
16615
+ if (disposalValue !== null && disposalValue !== undefined) {
16616
+ init.deoptimizeArgumentsOnInteractionAtPath(call, path, SHARED_RECURSION_TRACKER);
16617
+ init.includeCallArgumentsWhenCalledAtPath(path, call, context);
16618
+ }
16619
+ return false;
16620
+ }
16621
+ this.disposalFunction = disposalFunction;
16622
+ this.disposalCall = call;
16623
+ disposalFunction.deoptimizeArgumentsOnInteractionAtPath(call, EMPTY_PATH, SHARED_RECURSION_TRACKER);
16624
+ return true;
16625
+ }
16500
16626
  }
16501
16627
  VariableDeclarator.prototype.applyDeoptimizations = doNotDeoptimize;
16502
16628
  const SYMBOL_DISPOSE_PATH = [SymbolDispose];
@@ -17481,6 +17607,9 @@ function decodedSourcemap(map) {
17481
17607
  if (typeof map === 'string') {
17482
17608
  map = JSON.parse(map);
17483
17609
  }
17610
+ if ('sections' in map) {
17611
+ map = flattenIndexSourceMap(map);
17612
+ }
17484
17613
  if (!map.mappings) {
17485
17614
  return {
17486
17615
  mappings: [],
@@ -17516,6 +17645,74 @@ function decodedSourcemap(map) {
17516
17645
  sourceMapCache.set(decodedMap, cache);
17517
17646
  return decodedMap;
17518
17647
  }
17648
+ function flattenIndexSourceMap({ file, sections }) {
17649
+ const mappings = [];
17650
+ const names = [];
17651
+ const sources = [];
17652
+ const sourcesContent = [];
17653
+ // As when collapsing sourcemaps, sources with the same name are shared unless their contents differ
17654
+ const sourceIndicesByName = new Map();
17655
+ for (const { map, offset } of sections) {
17656
+ const section = decodedSourcemap(map);
17657
+ const { sourceRoot } = section;
17658
+ const sourcePrefix = sourceRoot
17659
+ ? sourceRoot.endsWith('/')
17660
+ ? sourceRoot
17661
+ : `${sourceRoot}/`
17662
+ : '';
17663
+ const sourceIndices = section.sources.map((source, index) => {
17664
+ const name = source == null || isAbsolute$1(source) ? source : sourcePrefix + source;
17665
+ const content = section.sourcesContent?.[index] ?? null;
17666
+ let indices = sourceIndicesByName.get(name);
17667
+ if (!indices) {
17668
+ sourceIndicesByName.set(name, (indices = []));
17669
+ }
17670
+ let sourceIndex = indices.find(candidate => content == null ||
17671
+ sourcesContent[candidate] == null ||
17672
+ sourcesContent[candidate] === content);
17673
+ if (sourceIndex === undefined) {
17674
+ sourceIndex = sources.push(name) - 1;
17675
+ sourcesContent.push(content);
17676
+ indices.push(sourceIndex);
17677
+ }
17678
+ else {
17679
+ sourcesContent[sourceIndex] ??= content;
17680
+ }
17681
+ return sourceIndex;
17682
+ });
17683
+ const namesOffset = names.length;
17684
+ for (const name of section.names ?? []) {
17685
+ names.push(name);
17686
+ }
17687
+ for (const [lineIndex, line] of section.mappings.entries()) {
17688
+ const generatedLine = offset.line + lineIndex;
17689
+ while (mappings.length <= generatedLine) {
17690
+ mappings.push([]);
17691
+ }
17692
+ // Only the first line of a section starts at the column offset
17693
+ const columnOffset = lineIndex === 0 ? offset.column : 0;
17694
+ for (const segment of line) {
17695
+ const flatSegment = segment.slice();
17696
+ flatSegment[0] += columnOffset;
17697
+ if (flatSegment.length !== 1) {
17698
+ flatSegment[1] = sourceIndices[flatSegment[1]];
17699
+ if (flatSegment.length === 5) {
17700
+ flatSegment[4] += namesOffset;
17701
+ }
17702
+ }
17703
+ mappings[generatedLine].push(flatSegment);
17704
+ }
17705
+ }
17706
+ }
17707
+ return {
17708
+ file,
17709
+ mappings,
17710
+ names,
17711
+ sources,
17712
+ sourcesContent,
17713
+ version: 3
17714
+ };
17715
+ }
17519
17716
 
17520
17717
  function getId(m) {
17521
17718
  return m.id;
@@ -21371,7 +21568,10 @@ function getCollapsedSourcemap(id, originalCode, originalSourcemap, sourcemapCha
21371
21568
  const sourcesContent = originalSourcemap.sourcesContent || [];
21372
21569
  const directory = dirname(id) || '.';
21373
21570
  const sourceRoot = originalSourcemap.sourceRoot || '.';
21374
- const baseSources = sources.map((source, index) => new Source(resolve$1(directory, sourceRoot, source), sourcesContent[index]));
21571
+ // A source whose name is not known is null, and mappings to it are treated as unmapped
21572
+ const baseSources = sources.map((source, index) => source == null
21573
+ ? null
21574
+ : new Source(resolve$1(directory, sourceRoot, source), sourcesContent[index]));
21375
21575
  source = new Link(originalSourcemap, baseSources);
21376
21576
  }
21377
21577
  else {
@@ -21404,13 +21604,17 @@ function collapseSourcemaps(file, map, modules, bundleSourcemapChain, excludeCon
21404
21604
  });
21405
21605
  }
21406
21606
  function collapseSourcemap(id, originalCode, originalSourcemap, sourcemapChain, log) {
21407
- if (sourcemapChain.length === 0) {
21607
+ if (sourcemapChain.length === 0 &&
21608
+ (!originalSourcemap || hasOnlyNamedSources(originalSourcemap))) {
21408
21609
  return originalSourcemap;
21409
21610
  }
21410
21611
  const source = getCollapsedSourcemap(id, originalCode, originalSourcemap, sourcemapChain, getLinkMap(log));
21411
21612
  const map = source.traceMappings();
21412
21613
  return decodedSourcemap({ version: 3, ...map });
21413
21614
  }
21615
+ function hasOnlyNamedSources(map) {
21616
+ return map.sources.every(source => source != null);
21617
+ }
21414
21618
 
21415
21619
  let textEncoder;
21416
21620
  const getHash64 = input => xxhashBase64Url(ensureBuffer(input));
@@ -21740,7 +21944,12 @@ class Bundle {
21740
21944
  await renderChunks(chunks, outputBundle, this.pluginDriver, this.outputOptions, this.inputOptions.onLog);
21741
21945
  }
21742
21946
  catch (error_) {
21743
- await this.pluginDriver.hookParallel('renderError', [error_]);
21947
+ try {
21948
+ await this.pluginDriver.hookParallel('renderError', [error_]);
21949
+ }
21950
+ catch (hookError) {
21951
+ error(logErrorInHook(error_, hookError, 'renderError'));
21952
+ }
21744
21953
  throw error_;
21745
21954
  }
21746
21955
  removeUnreferencedAssets(outputBundle);
@@ -24595,11 +24804,7 @@ async function rollupInternal(rawInputOptions, registerWatchHooks) {
24595
24804
  await graph.pluginDriver.hookParallel('buildEnd', [error_]);
24596
24805
  }
24597
24806
  catch (buildEndError) {
24598
- // Create a compound error object to include both errors, based on the original error
24599
- const compoundError = getRollupError({
24600
- ...error_,
24601
- message: `There was an error during the build:\n ${error_.message}\nAdditionally, handling the error in the 'buildEnd' hook caused the following error:\n ${buildEndError.message}`
24602
- });
24807
+ const compoundError = getRollupError(logErrorInHook(error_, buildEndError, 'buildEnd'));
24603
24808
  await graph.pluginDriver.hookParallel('closeBundle', [compoundError]).catch(() => { });
24604
24809
  throw compoundError;
24605
24810
  }
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  @license
3
- Rollup.js v4.65.0
4
- Thu, 22 Oct 2026 08:51:29 GMT - commit 9aac09a39dc1fa297a7b06f1ad6907f7bd41b310
3
+ Rollup.js v4.66.0
4
+ Wed, 28 Oct 2026 13:27:47 GMT - commit 4de8104f55fe5c0df06aab54c1f9f2967dbe66ac
5
5
 
6
6
  https://github.com/rollup/rollup
7
7
 
@@ -341,6 +341,15 @@ function getRollupError(base) {
341
341
  });
342
342
  return errorInstance;
343
343
  }
344
+ function logErrorInHook(originalError, hookError, hookName) {
345
+ augmentLogMessage(originalError);
346
+ augmentLogMessage(hookError);
347
+ const phase = hookName === 'buildEnd' ? 'the build' : 'rendering';
348
+ return {
349
+ ...originalError,
350
+ message: `There was an error during ${phase}:\n ${originalError.message}\nAdditionally, handling the error in the '${hookName}' hook caused the following error:\n ${hookError.message}`
351
+ };
352
+ }
344
353
  function augmentCodeLocation(properties, pos, source, id) {
345
354
  if (typeof pos === 'object') {
346
355
  const { line, column } = pos;
@@ -2141,4 +2150,4 @@ function getAstBuffer(astBuffer) {
2141
2150
  const parseAst = (input, { allowReturnOutsideFunction = false, jsx = false } = {}) => convertProgram(getAstBuffer(parse(input, allowReturnOutsideFunction, jsx)));
2142
2151
  const parseAstAsync = async (input, { allowReturnOutsideFunction = false, jsx = false, signal } = {}) => convertProgram(getAstBuffer(await parseAsync(input, allowReturnOutsideFunction, jsx, signal)));
2143
2152
 
2144
- export { ANNOTATION_KEY, ArrowFunctionExpression, AwaitExpression, BLANK, BlockStatement, CallExpression, CatchClause, EMPTY_ARRAY, EMPTY_OBJECT, EMPTY_SET, ExportDefaultDeclaration, ExpressionStatement, FIXED_STRINGS, FunctionExpression, INVALID_ANNOTATION_KEY, Identifier, LOGLEVEL_DEBUG, LOGLEVEL_ERROR, LOGLEVEL_INFO, LOGLEVEL_WARN, Literal, MemberExpression, ObjectExpression, Program, Property, RestElement, ReturnStatement, StaticBlock, TemplateLiteral, URL_GENERATEBUNDLE, URL_JSX, URL_LOAD, URL_OUTPUT_AMD_BASEPATH, URL_OUTPUT_AMD_ID, URL_OUTPUT_DIR, URL_OUTPUT_EXTERNALIMPORTATTRIBUTES, URL_OUTPUT_FORMAT, URL_OUTPUT_GENERATEDCODE, URL_OUTPUT_INLINEDYNAMICIMPORTS, URL_OUTPUT_INTEROP, URL_OUTPUT_MANUALCHUNKS, URL_OUTPUT_SOURCEMAPBASEURL, URL_OUTPUT_SOURCEMAPFILE, URL_PRESERVEENTRYSIGNATURES, URL_TRANSFORM, URL_TREESHAKE, URL_TREESHAKE_MODULESIDEEFFECTS, URL_WATCH, VariableDeclarator, addTrailingSlashIfMissed, augmentCodeLocation, augmentLogMessage, convertAnnotations, convertNode, error, getAliasName, getAstBuffer, getImportPath, getRollupError, isAbsolute, isPathFragment, isRelative, isValidUrl, locate, logAddonNotGenerated, logAlreadyClosed, logAmbiguousExternalNamespaces, logAnonymousPluginCache, logAssetNotFinalisedForFileName, logAssetReferenceIdNotFoundForSetSource, logAssetSourceAlreadySet, logBadLoader, logCannotAssignModuleToChunk, logCannotCallNamespace, logCannotEmitFromOptionsHook, logChunkInvalid, logChunkNotGeneratedForFileName, logCircularChunk, logCircularDependency, logCircularReexport, logConflictingSourcemapSources, logConstVariableReassignError, logCyclicCrossChunkReexport, logDuplicateArgumentNameError, logDuplicateExportError, logDuplicatePluginName, logEmptyChunk, logEntryCannotBeExternal, logEval, logExternalModulesCannotBeIncludedInManualChunks, logExternalModulesCannotBeTransformedToModules, logExternalSyntheticExports, logFailedValidation, logFileNameConflict, logFileNameOutsideOutputDirectory, logFileReferenceIdNotFoundForFilename, logFirstSideEffect, logIllegalIdentifierAsName, logIllegalImportReassignment, logImplicitDependantCannotBeExternal, logImplicitDependantIsNotIncluded, logImportAttributeIsInvalid, logImportOptionsAreInvalid, logIncompatibleExportOptionValue, logInconsistentImportAttributes, logInputHookInOutputPlugin, logInternalIdCannotBeExternal, logInvalidAddonPluginHook, logInvalidAnnotation, logInvalidExportOptionValue, logInvalidFormatForTopLevelAwait, logInvalidFunctionPluginHook, logInvalidLogPosition, logInvalidOption, logInvalidRollupPhaseForChunkEmission, logInvalidSetAssetSourceCall, logInvalidSourcemapForError, logLevelPriority, logMissingEntryExport, logMissingExport, logMissingFileOrDirOption, logMissingGlobalName, logMissingJsxExport, logMissingNameOptionForIifeExport, logMissingNameOptionForUmdExport, logMissingNodeBuiltins, logMixedExport, logModuleLevelDirective, logModuleParseError, logNamespaceConflict, logNoAssetSourceSet, logNoTransformMapOrAstWithoutCode, logNonExternalSourcePhaseImport, logOptimizeChunkStatus, logParseError, logPluginError, logRedeclarationError, logReservedNamespace, logShimmedExport, logSourcePhaseFormatUnsupported, logSourcemapBroken, logSyntheticNamedExportsNeedNamespaceExport, logThisIsUndefined, logUnexpectedNamedImport, logUnexpectedNamespaceReexport, logUnknownOption, logUnresolvedEntry, logUnresolvedImplicitDependant, logUnresolvedImport, logUnresolvedImportTreatedAsExternal, logUnusedExternalImports, normalize, parseAst, parseAstAsync, printQuotedStringList, relative, relativeId, warnDeprecation };
2153
+ export { ANNOTATION_KEY, ArrowFunctionExpression, AwaitExpression, BLANK, BlockStatement, CallExpression, CatchClause, EMPTY_ARRAY, EMPTY_OBJECT, EMPTY_SET, ExportDefaultDeclaration, ExpressionStatement, FIXED_STRINGS, FunctionExpression, INVALID_ANNOTATION_KEY, Identifier, LOGLEVEL_DEBUG, LOGLEVEL_ERROR, LOGLEVEL_INFO, LOGLEVEL_WARN, Literal, MemberExpression, ObjectExpression, Program, Property, RestElement, ReturnStatement, StaticBlock, TemplateLiteral, URL_GENERATEBUNDLE, URL_JSX, URL_LOAD, URL_OUTPUT_AMD_BASEPATH, URL_OUTPUT_AMD_ID, URL_OUTPUT_DIR, URL_OUTPUT_EXTERNALIMPORTATTRIBUTES, URL_OUTPUT_FORMAT, URL_OUTPUT_GENERATEDCODE, URL_OUTPUT_INLINEDYNAMICIMPORTS, URL_OUTPUT_INTEROP, URL_OUTPUT_MANUALCHUNKS, URL_OUTPUT_SOURCEMAPBASEURL, URL_OUTPUT_SOURCEMAPFILE, URL_PRESERVEENTRYSIGNATURES, URL_TRANSFORM, URL_TREESHAKE, URL_TREESHAKE_MODULESIDEEFFECTS, URL_WATCH, VariableDeclarator, addTrailingSlashIfMissed, augmentCodeLocation, augmentLogMessage, convertAnnotations, convertNode, error, getAliasName, getAstBuffer, getImportPath, getRollupError, isAbsolute, isPathFragment, isRelative, isValidUrl, locate, logAddonNotGenerated, logAlreadyClosed, logAmbiguousExternalNamespaces, logAnonymousPluginCache, logAssetNotFinalisedForFileName, logAssetReferenceIdNotFoundForSetSource, logAssetSourceAlreadySet, logBadLoader, logCannotAssignModuleToChunk, logCannotCallNamespace, logCannotEmitFromOptionsHook, logChunkInvalid, logChunkNotGeneratedForFileName, logCircularChunk, logCircularDependency, logCircularReexport, logConflictingSourcemapSources, logConstVariableReassignError, logCyclicCrossChunkReexport, logDuplicateArgumentNameError, logDuplicateExportError, logDuplicatePluginName, logEmptyChunk, logEntryCannotBeExternal, logErrorInHook, logEval, logExternalModulesCannotBeIncludedInManualChunks, logExternalModulesCannotBeTransformedToModules, logExternalSyntheticExports, logFailedValidation, logFileNameConflict, logFileNameOutsideOutputDirectory, logFileReferenceIdNotFoundForFilename, logFirstSideEffect, logIllegalIdentifierAsName, logIllegalImportReassignment, logImplicitDependantCannotBeExternal, logImplicitDependantIsNotIncluded, logImportAttributeIsInvalid, logImportOptionsAreInvalid, logIncompatibleExportOptionValue, logInconsistentImportAttributes, logInputHookInOutputPlugin, logInternalIdCannotBeExternal, logInvalidAddonPluginHook, logInvalidAnnotation, logInvalidExportOptionValue, logInvalidFormatForTopLevelAwait, logInvalidFunctionPluginHook, logInvalidLogPosition, logInvalidOption, logInvalidRollupPhaseForChunkEmission, logInvalidSetAssetSourceCall, logInvalidSourcemapForError, logLevelPriority, logMissingEntryExport, logMissingExport, logMissingFileOrDirOption, logMissingGlobalName, logMissingJsxExport, logMissingNameOptionForIifeExport, logMissingNameOptionForUmdExport, logMissingNodeBuiltins, logMixedExport, logModuleLevelDirective, logModuleParseError, logNamespaceConflict, logNoAssetSourceSet, logNoTransformMapOrAstWithoutCode, logNonExternalSourcePhaseImport, logOptimizeChunkStatus, logParseError, logPluginError, logRedeclarationError, logReservedNamespace, logShimmedExport, logSourcePhaseFormatUnsupported, logSourcemapBroken, logSyntheticNamedExportsNeedNamespaceExport, logThisIsUndefined, logUnexpectedNamedImport, logUnexpectedNamespaceReexport, logUnknownOption, logUnresolvedEntry, logUnresolvedImplicitDependant, logUnresolvedImport, logUnresolvedImportTreatedAsExternal, logUnusedExternalImports, normalize, parseAst, parseAstAsync, printQuotedStringList, relative, relativeId, warnDeprecation };