unstale

npm / rollup

rollup

What changed in rollup 2 to 4, from its official release notes, upgrade guides and advisories. Also covers @rollup/rollup-darwin-arm64, @rollup/rollup-darwin-x64, @rollup/rollup-linux-arm64-gnu, @rollup/rollup-linux-arm64-musl, @rollup/rollup-linux-x64-gnu, @rollup/rollup-linux-x64-musl, @rollup/rollup-win32-arm64-msvc, @rollup/rollup-win32-x64-msvc. Sources checked 2026-12-04.

81 breaking1 security21 deprecations15 new APIs and options5 performance29 behavior and defaults2 tooling80 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

rollup 4134 changes

Breaking changes 32

  • Deeply nested expressions now fail the build with a parse error instead of causing a native stack overflow.

    4.68.6release notes

  • Rollup now fails if generated file names would write outside the target directory using Windows drive-relative paths.

    4.68.2release notes

  • Deleting or reassigning namespace members now produces catchable runtime errors, and namespace property references are preserved in delete expressions.

    4.68.1release notes

  • Dynamic chunks for index.js files use the directory name instead of "index".

    4.68.0release notes

  • The build-only optional dependency is no longer published, avoiding an unnecessary optional dependency on Linux.

    4.67.5release notes

  • Rollup throws if the generated bundle contains paths that would leave the output directory.

    3.30.0, 4.59.0release notesrelease notes

  • The acorn option has been removed.

    4.0.0release notes

  • This configuration option is no longer available, so it can no longer be used to add plugins for unsupported syntax.

    4.0.0upgrade guide

  • Acorn plugins are no longer supported, and this option has been removed.

    4.0.0release notes

  • The plugin interface replaces “assertions” with “attributes” in various places.

    4.0.0release notesupgrade guide

  • Import attributes use the attributes field in the resolveId hook and other places, replacing assertions.

    4.0.0upgrade guide

  • The browser build now relies on a WASM artifact that must also be provided.

    4.0.0release notesupgrade guide

  • Generated file hashes now use URL-safe base64 encoding.

    4.0.0release notes

  • File names now use url-safe base64 hashes instead of base16 hashes; hash length is limited to at most 21 characters.

    4.0.0upgrade guide

  • The abstract syntax tree representation of import attributes now follows the ESTree spec again.

    4.0.0upgrade guide

  • This option was removed from input options; use the corresponding output option.

    4.0.0release notes

  • This error code was replaced with INVALID_IMPORT_ATTRIBUTE.

    4.0.0release notes

  • Watch mode no longer watches ids of files loaded through a plugin load hook; plugins must call this.addWatchFile() for files they depend on.

    4.0.0upgrade guide

  • The maximum hash length is now 22 characters.

    4.0.0release notes

  • Rollup automatically installs and removes native code as an optional npm dependency on supported platforms and architectures; unsupported systems receive an error listing supported platforms and architectures.

    4.0.0upgrade guide

  • The minimum required Node version is now 18.0.0.

    4.0.0release notesupgrade guide

  • Normalized input options provided by hooks no longer contain an onwarn handler; plugins should use onLog instead.

    4.0.0release notesupgrade guide

  • When using the browser build with Vite, add @rollup/browser to this setting to avoid an invalid WASM file path when running the dev server.

    4.0.0upgrade guide

  • This output option was removed; use the renderDynamicImport plugin hook instead.

    4.0.0release notes

  • This option was removed because Rollup now always runs the full chunking algorithm.

    4.0.0release notes

  • This output option was removed; use output.generatedCode.symbols instead.

    4.0.0release notes

  • This output option was removed; use output.generatedCode.constBindings instead.

    4.0.0release notes

  • When a plugin load hook handles a module id corresponding to a real path, Rollup no longer watches the actual file; plugins must call this.addWatchFile for dependency files when needed.

    4.0.0release notes

  • The RollupWarning type was removed in favor of RollupLog.

    4.0.0release notes

  • Plugins should no longer access this property; use this.getModuleIds() instead.

    3.0.0, 4.0.0release notesrelease notes

  • this.parse now only supports the allowReturnOutsideFunction option for now.

    4.0.0release notes

  • The default value of the skipSelf option is now true.

    4.0.0release notesupgrade guide

Security 1

Deprecations 2

  • Returning import attributes from load or transform hooks is deprecated and will no longer be supported with Rollup 5.

    4.57.0release notes

  • This option is deprecated in favor of output.externalImportAttributes.

    4.0.0release notes

New APIs and options 4

  • Rollup supports source phase imports as long as they are external.

    4.60.0release notes

  • Import attributes are now available in plugin hooks that did not provide them before.

    4.57.0release notes

  • The parser is exposed as a separate export named parseAst.

    4.0.0release notes

  • Users on platforms unsupported by the optional native binary can use this package, which has the same interface as Rollup and relies on WASM artifacts.

    4.0.0release notesupgrade guide

Performance 4

  • Rendering ES output is slightly faster by avoiding repeated export name scans when rendering ES chunks.

    4.64.1release notes

  • Unused Symbol.hasInstance, Symbol.dispose and Symbol.asyncDispose properties can now be tree-shaken.

    4.54.0release notes

  • Caching generated variable names improves rendering performance.

    4.53.0release notes

  • Rollup switches to a native SWC-based parser to improve parsing speed.

    4.0.0release notes

Behavior and default changes 12

  • Cached sourcemaps are used when available when reading cached files.

    4.68.0release notes

  • Namespace members accessed through default exports can now be tree-shaken.

    4.68.0release notes

  • Supports synthetic named exports in namespaces when preserving modules.

    4.65.0release notes

  • Try-catch deoptimization now covers calling methods on objects, retaining callbacks of helper methods called from try statements.

    4.64.0release notes

  • Rollup can analyze function return values in more cases, which may affect build-time analysis.

    4.63.0release notes

  • Static dependencies shared between manual chunks and entry points are extracted into separate chunks.

    4.62.0release notes

  • Entry modules are sorted to make chunk hash names deterministic.

    4.61.0release notes

  • Rollup also supports the annotation before variable declarations that declare function expressions.

    4.58.0release notes

  • Rollup tracks object property inclusions of dynamic namespace members.

    4.56.0release notes

  • Import assertions now use the new import attribute AST structure.

    4.0.0release notes

  • Rollup now warns when this annotation appears in an invalid location.

    4.0.0release notesupgrade guide

  • If an entry module starts with a shebang comment, it is prepended to output for es and cjs formats.

    4.0.0release notesupgrade guide

Tooling 1

  • Adds an android-x64 native build, extending Rollup support to X64 Android.

    4.67.2release notes

Fixes and other changes 78

  • Reverts a previous fix that was breaking bundling in certain cases.

    4.68.7release notes

  • Properly preserves this in JSX member expressions.

    4.68.5release notes

  • Rebuilds with the latest content when a watched file changes in quick succession on Linux and Windows.

    4.68.5release notes

  • Dynamic imports resolved via plugins are now handled equivalently to regular dynamic imports.

    4.68.4release notes

  • Mutations of arguments exposed through the return values of certain known global methods are now respected in analysis.

    4.68.4release notes

  • Rollup no longer assumes it knows an array’s contents when its length has been reassigned.

    4.68.3release notes

  • Fixes generated code for assignments and exported declarations in loops and single-statement bodies.

    4.68.3release notes

  • Improves namespace object generation in cyclic imports, including namespace bindings initialized later in a cycle.

    4.68.1release notes

  • Fixes invalid generated code when non-ESM output exports destructuring declarations with defaults.

    4.68.1release notes

  • Names beginning with a literal * are no longer confused with internal namespace import placeholders.

    4.68.0release notes

  • A shared module accessed through different dynamic imports is no longer wrongly merged into the first.

    4.68.0release notes

  • Chunk hashes now change when debug IDs are enabled or disabled.

    4.67.5release notes

  • Honors output.sourcemapFile when output.file is not set.

    4.67.5release notes

  • Rollup works again on older Xeon processors by building linux-x64-gnu C code for baseline x86-64 CPUs.

    4.67.4release notes

  • Line breaks in module ids are now handled correctly in imports.

    4.67.3release notes

  • Index sourcemaps returned by plugins are flattened.

    4.66.0release notes

  • Null sources in plugin-generated sourcemaps are treated as unmapped.

    4.66.0release notes

  • Rendering errors are preserved when the renderError hook fails.

    4.66.0release notes

  • Tree-shaking now respects Symbol.dispose for async disposal.

    4.65.1release notes

  • Forwards startup errors that occur while loading native modules when starting Rollup.

    4.65.0release notes

  • Fixes wrong log-location segments when sourcemaps are unaligned.

    4.65.0release notes

  • Global or sticky regular expressions used for file names are now handled consistently.

    4.64.12release notes

  • Logs from transform hooks at position 0 can now be generated.

    4.64.12release notes

  • Properly decodes HTML entities in JSX output.

    4.64.10release notes

  • Avoids breaking lazy loading when a dynamic import only contains reexports from a manual chunk.

    4.64.10release notes

  • Live-bindings are now properly maintained for aliased exports.

    4.64.9release notes

  • Typed array constructor calls are retained when their argument has iteration side effects.

    4.64.9release notes

  • Chunk hashes now change when sourcemap comments change, avoiding stale hashes when those comments are modified.

    4.64.8release notes

  • Fixes some relative import resolution edge cases, matching Node's join and relative behavior for "." and ".." segments in the browser.

    4.64.8release notes

  • Fixes watching not-yet-created files from plugins when several share a directory.

    4.64.7release notes

  • Side effects in class instance field initializers are retained when instantiating a class, avoiding incorrect tree-shaking.

    4.64.6release notes

  • Detection now recognizes top-level asynchronous for...of loops and async disposal.

    4.64.6release notes

  • Prevents cycles when using indirect top-level await for dynamic imports.

    4.64.5release notes

  • The Rollup WASM build is supported on big-endian hosts.

    4.64.4release notes

  • Fixes a performance regression when bundling code with deeply nested property calls.

    4.64.3release notes

  • When build errors occur, errors from closeBundle no longer replace them.

    4.64.2release notes

  • Certain CoreJS helpers are no longer wrongly tree-shaken.

    4.64.2release notes

  • Fixes cases where some core-js feature-detections were not triggering properly.

    4.64.0release notes

  • External re-exports used in a reified dynamic namespace are now always imported.

    4.63.6release notes

  • Watch mode now terminates when closed via Ctrl+C instead of hanging.

    4.63.5release notes

  • Watch mode no longer starts overlapping runs when plugins invalidate files at the wrong time.

    4.63.5release notes

  • Watch mode events are now emitted to listeners correctly in edge cases, especially when errors occur.

    4.63.5release notes

  • Quotes and backslashes in import attribute values are escaped so Rollup does not generate invalid code.

    4.63.4release notes

  • Cached module meta information is now exposed in shouldTransformCachedModule, allowing plugins to access it during cache checks.

    4.63.4release notes

  • The browser shims for basename and extname now fully match NodeJS.

    4.63.3release notes

  • Tree-shaking respects Windows line terminators when removing line breaks needed to prevent automatic semicolon insertion.

    4.63.3release notes

  • Failures on invalidation are always reported and recovered from in watch mode.

    4.63.3release notes

  • Fixes filtering logs by nested properties via the CLI when those properties have primitive values.

    4.63.2release notes

  • Function return value tracking was reverted until the most recent issue is understood.

    4.63.1release notes

  • Fixes invalid module concatenations that could result from compact mode.

    4.62.5release notes

  • Resolves a regression when using Rollup on older Linux distributions and enforces glibc ≤ 2.28 compatibility.

    4.62.4release notes

  • Illegal characters in the preserved modules input base are sanitized before computing preserved module chunk names.

    4.62.3release notes

  • When using minChunkSize with hoisting disabled, Rollup no longer adds spurious side-effect-free external imports to chunks.

    4.62.2release notes

  • Fix an issue where getLogFilter would match additional logs.

    4.62.1release notes

  • Preserve multipart file extensions when deconflicting output chunks by inserting conflict numbers before the first extension.

    4.62.1release notes

  • Avoids extraneous newlines when adding headers via plugins.

    4.61.1release notes

  • Fixes a rare issue where starting Rollup would hang on Windows.

    4.61.1release notes

  • Chunk assignment is stabilized across parallel file reads, improving the stability of chunk hashes.

    4.60.4release notes

  • Fixes variable rendering when generating different formats from the same build.

    4.60.2release notes

  • Fixes a caching issue that could cause side effect imports to be dropped.

    4.60.1release notes

  • Fixes a crash when using lazy dynamic imports with moduleSideEffects:false.

    4.59.1release notes

  • Ensures exports of a dynamic import are fully included when called from a try...catch.

    4.57.1release notes

  • Fixes a heap corruption issue on Windows.

    4.57.1release notes

  • Rollup handles methods that access dynamically imported namespace members via this.

    4.56.0release notes

  • Fixes the semicolon insertion position in JSX variable declarations.

    4.55.3release notes

  • Manual chunks are sorted by module execution order to reduce circular dependency issues.

    4.55.2release notes

  • Fixes the artifact reference for OpenBSD, so developers can use the correct release artifact.

    4.55.1release notes

  • Namespace properties referenced only from a try-catch are included.

    4.54.0release notes

  • Well-known-Symbol-valued properties are no longer tree-shaken except in select cases.

    4.54.0release notes

  • Fixes the semicolon insertion position when using JSX.

    4.53.5release notes

  • Generates spec-compliant sourcemaps when sources content is excluded by setting sourcesContent to undefined instead of null.

    4.53.5release notes

  • Rollup no longer removes Symbol.asyncDispose properties with (await) using declarations.

    4.53.4release notes

  • Rollup no longer removes Symbol.dispose properties with (await) using declarations.

    4.53.4release notes

  • Fixes assignments being wrongly tree-shaken when they mutate a value.

    4.53.3release notes

  • Fixes an error that flagged too many modules as having an unused external import.

    4.53.3release notes

  • Rollup no longer throws when using invalid escape sequences in template literals.

    4.53.2release notes

  • Sourcemap debugIds are now always valid UUIDs, avoiding invalid-length identifiers.

    4.52.5release notes

  • The with syntax for import attributes is not yet supported.

    4.0.0release notes

rollup 364 changes

Breaking changes 34

  • Assets are deduplicated with previously emitted assets only when their source is a string.

    3.0.0release notes

  • Configuration files are bundled only when this option or --bundleConfigAsCjs is used; otherwise Node's native mechanisms load them.

    3.0.0release notes

  • Functions no longer receive rendered module information through modules; they receive a list of included moduleIds.

    3.0.0release notes

  • Module-referencing properties such as id and ids now contain full ids; only error messages use shortened ids.

    3.0.0release notes

  • Plugins should use this.getModuleInfo(...).moduleSideEffects instead.

    3.0.0release notes

  • Emitted assets no longer have this flag in the bundle.

    3.0.0release notes

  • This helper now has a named export of the same name instead of a default export.

    3.0.0release notes

  • Its default is now ifRelativeSource, so absolute external imports stay absolute while relative external imports are renormalized.

    3.0.0release notes

  • Rollup now requires Node 14.18.0 or later to run.

    3.0.0release notes

  • Hooks defined in output plugins now run after hooks defined in input plugins.

    3.0.0release notes

  • Functions supplied for these output options are now called per chunk with chunk information.

    3.0.0release notes

  • The default is now if-default-prop, which only adds __esModule when the default export would be a property.

    3.0.0release notes

  • The default no longer quotes properties such as default.

    3.0.0release notes

  • The values true and false are no longer accepted; use compat as a replacement for true.

    3.0.0release notes

  • The default is now default to better align with NodeJS interop.

    3.0.0release notes

  • The default is now true, requiring at least SystemJS 6.3.3.

    3.0.0release notes

  • The order of plugin hooks during output generation has changed.

    3.0.0release notes

  • Its default is now exports-only, so empty facades for entry chunks are no longer created by default.

    3.0.0release notes

  • The [ext], [extName], and [assetExtName] placeholders are no longer supported when preserving modules.

    3.0.0release notes

  • When preserving modules, [name] and chunkInfo.name now include the relative chunk path and may include its extension.

    3.0.0release notes

  • Chunk information now uses hash placeholders for names, replaced when used in returned code or chunk import/export information.

    3.0.0release notes

  • This plugin hook was removed; use resolveFileUrl instead.

    3.0.0release notes

  • Rollup no longer passes the assetReferenceId parameter to this hook.

    3.0.0release notes

  • Rollup no longer passes the chunkReferenceId parameter to this hook.

    3.0.0release notes

  • The browser build is now available as a separate package.

    3.0.0release notes

  • Files in this path can only be required using their file extension.

    3.0.0release notes

  • This plugin context function was removed; use this.emitFile() instead.

    3.0.0release notes

  • This plugin context function was removed; use this.emitFile() instead.

    3.0.0release notes

  • This plugin context function was removed; use this.getFileName() instead.

    3.0.0release notes

  • This plugin context function was removed; use this.getFileName() instead.

    3.0.0release notes

  • This plugin context function was removed; use this.resolve() instead.

    3.0.0release notes

  • This plugin context function was removed; use this.resolve() instead.

    3.0.0release notes

  • This option was removed; use treeshake.moduleSideEffects: 'no-external' instead.

    3.0.0release notes

  • Rollup no longer adds type: "asset" when assets are added directly to the bundle.

    3.0.0release notes

Deprecations 7

  • The input option is deprecated; use output.inlineDynamicImports instead.

    3.0.0release notes

  • The input option is deprecated; use output.manualChunks instead.

    3.0.0release notes

  • This option is deprecated; use maxParallelFileOps instead.

    3.0.0release notes

  • This option is deprecated; use the renderDynamicImport plugin hook instead.

    3.0.0release notes

  • This option is deprecated; use output.generatedCode.symbols instead.

    3.0.0release notes

  • This option is deprecated; use output.generatedCode.constBindings instead.

    3.0.0release notes

  • The input option is deprecated; use output.preserveModules instead.

    3.0.0release notes

New APIs and options 8

  • This option forces configuration files to be bundled to CommonJS.

    3.0.0release notes

  • The length of generated file hashes can now be customized globally and per chunk.

    3.0.0release notes

  • Plugins can add, remove, or change import assertions when resolving ids.

    3.0.0release notes

  • This option controls whether dynamic imports in CommonJS output remain import(…) or are wrapped as require(…); by default they remain imports.

    3.0.0release notes

  • This value adds an __esModule marker only if a default export is rendered as a property.

    3.0.0release notes

  • This option turns off emission of import assertions.

    3.0.0release notes

  • The new compat value is similar to auto but uses duck-typing to determine whether there is a default export.

    3.0.0release notes

  • Plugins can access the entire chunk graph through an additional parameter.

    3.0.0release notes

Performance 1

  • Performance issues when emitting thousands of assets are avoided.

    3.0.0release notes

Behavior and default changes 12

  • Errors thrown in response to other errors use the standardized cause property to reference the original error.

    3.0.0release notes

  • Hashes now depend only on chunk content and remain stable against renamed or moved source files and changed module resolution order.

    3.0.0release notes

  • Assertions on external imports present in input files are retained in ESM output, and conflicting assertions trigger a warning.

    3.0.0release notes

  • This placeholder is now supported when preserving modules.

    3.0.0release notes

  • The option no longer times asynchronous plugin-hook work and adapts timings to the new hashing algorithm.

    3.0.0release notes

  • The option now collects synchronous timings for all plugin hooks rather than only a small selection.

    3.0.0release notes

  • Plugins modifying imports or exports in this hook should update ChunkInfo.imports/importedBindings/exports accordingly.

    3.0.0release notes

  • All errors thrown by Rollup now have name: RollupError, identifying them as custom error types.

    3.0.0release notes

  • Rollup waits for a Promise returned by an event handler attached to a watcher instance to resolve.

    3.0.0release notes

  • With the API and sourcemaps, comments are included in emitted files and sourcemaps are emitted as regular assets.

    3.0.0release notes

  • Rollup can statically resolve checks for foo[Symbol.toStringTag] to "Module" when foo is a namespace.

    3.0.0release notes

  • Watch mode uses a custom event implementation that awaits Promises returned from event handlers.

    3.0.0release notes

Tooling 1

  • The node build now uses the node: prefix for imports of builtin modules.

    3.0.0release notes

Fixes and other changes 1

  • Rollup no longer warns about implicitly using default export mode.

    3.0.0release notes

rollup 236 changes

Breaking changes 15

  • Plugins can only be used if they accept a passed-in Acorn instance instead of importing Acorn themselves.

    2.0.0release notes

  • TypeScript AST node types are now very generic and no longer use ESTree types or contain information specific to certain node types.

    2.0.0release notes

  • This option has been removed.

    2.0.0release notes

  • Modules that are completely tree-shaken are no longer listed as part of any chunks in this hook.

    2.0.0release notes

  • Rollup now requires at least Node 10 to run, or a sufficiently modern browser.

    2.0.0release notes

  • This plugin hook has been removed; use generateBundle instead.

    2.0.0release notes

  • This plugin hook has been removed; use writeBundle instead.

    2.0.0release notes

  • The ESM browser build moved here from rollup/dist/rollup.browser.es.js.

    2.0.0release notes

  • The main ESM entry point moved here from rollup/dist/rollup.es.js.

    2.0.0release notes

  • The plugin context no longer exposes this property.

    2.0.0release notes

  • The transform hook can no longer return dependencies.

    2.0.0release notes

  • This plugin hook has been removed; use renderChunk instead.

    2.0.0release notes

  • This plugin hook has been removed; use renderChunk instead.

    2.0.0release notes

  • This option accepts only an object of parameters passed to Rollup's bundled Chokidar instance; boolean values and user-installed Chokidar are no longer supported.

    2.0.0release notes

  • The hook now receives output options as its first parameter and the bundle object as its second, matching generateBundle.

    2.0.0release notes

Deprecations 12

  • Accessing this bundle property is deprecated; use chunk.type === 'asset' instead.

    2.0.0release notes

  • Directly adding properties to the bundle object in this hook is deprecated and warns; use this.emitFile. Removing properties remains allowed.

    2.0.0release notes

  • Using this in code now shows a warning; use import.meta.ROLLUP_FILE_URL_<..> instead.

    2.0.0release notes

  • Using this hook now shows a deprecation warning; use resolveFileUrl instead.

    2.0.0release notes

  • Using this plugin context function now shows a warning; use this.emitFile instead.

    2.0.0release notes

  • Using this plugin context function now shows a warning; use this.emitFile instead.

    2.0.0release notes

  • Using this plugin context function now shows a warning; use this.getFileName instead.

    2.0.0release notes

  • Using this plugin context function now shows a warning; use this.getFileName instead.

    2.0.0release notes

  • Using this plugin context function now shows a warning; use this.resolve instead.

    2.0.0release notes

  • Using this plugin context function now shows a warning; use this.resolve instead.

    2.0.0release notes

  • Use this option with 'no-external' instead of the deprecated treeshake.pureExternalModules option.

    2.0.0release notes

  • Using this option now shows a deprecation warning; use treeshake.moduleSideEffects: 'no-external' instead.

    2.0.0release notes

New APIs and options 3

  • Rollup can now be imported as an ES module in Node using conditional package exports; this is experimental.

    2.0.0release notes

  • Use this in place of the deprecated ROLLUP_ASSET_URL and ROLLUP_CHUNK_URL import.meta properties.

    2.0.0release notes

  • systemjs can now be used as a format alias for system.

    2.0.0release notes

Behavior and default changes 5

  • The error code for a missing name property when targeting UMD has changed to this code.

    2.0.0release notes

  • Rollup no longer introduces Node types into TypeScript projects that do not use them.

    2.0.0release notes

  • Empty imports from side-effect-free modules are not considered for chunking, side-effect imports are hoisted if necessary, and code-splitting produces better chunks.

    2.0.0release notes

  • Emitted chunks now have the TypeScript type UInt8Array instead of Buffer; Buffer can still be used.

    2.0.0release notes

  • Unknown output options now trigger a warning when using the JavaScript API.

    2.0.0release notes

Fixes and other changes 1

  • Sourcemaps are now generated correctly when tree-shaking occurs in a multi-file bundle.

    2.0.0release notes