Packages

rollup

4.68.5 · 17 Nov 2026MIT170.6M / weekRepositoryHomepagenpmAtom feed

Your version

4.0.0

major5 Oct 2023Where it was published

4.68.8 is the newest release of 4.x.

In short

22 breaking6 removed7 new4 fixed4 changed1 internal

  • Breaking

    The minimal required Node version is now 18.0.0

  • Breaking

    The browser build now relies on a WASM artifact that needs to be provided as well

  • Breaking

    The NodeJS build now relies on an optional native binary; for unsupported platforms, users can use the @rollup/wasm-node package that has the same interface as Rollup but relies on WASM artifacts

  • Breaking

    The "with" syntax for import attributes is not yet supported, awaiting support in SWC

  • Breaking

    The INVALID_IMPORT_ASSERTION error code has been replaced with INVALID_IMPORT_ATTRIBUTE

  • Breaking

    Rollup will now warn for @__PURE__ and @__NO_SIDE_EFFECTS__ annotations in invalid locations

  • Breaking

    If an entry module starts with a shebang comment #!..., this comment will be prepended to the output for es and cjs formats

  • Breaking

    File hashes will now use url-safe base64 encoded hashes

Security

2 advisories affect 4.0.0; 4.59.0 fixes them

Release note

2023-10-05

Breaking changes

General Changes

  • Breaking

    The minimal required Node version is now 18.0.0

  • Breaking

    The browser build now relies on a WASM artifact that needs to be provided as well

  • Breaking

    The NodeJS build now relies on an optional native binary; for unsupported platforms, users can use the @rollup/wasm-node package that has the same interface as Rollup but relies on WASM artifacts

  • Breaking

    The "with" syntax for import attributes is not yet supported, awaiting support in SWC

  • Breaking

    The INVALID_IMPORT_ASSERTION error code has been replaced with INVALID_IMPORT_ATTRIBUTE

  • Breaking

    Rollup will now warn for @__PURE__ and @__NO_SIDE_EFFECTS__ annotations in invalid locations

  • Breaking

    If an entry module starts with a shebang comment #!..., this comment will be prepended to the output for es and cjs formats

  • Breaking

    File hashes will now use url-safe base64 encoded hashes

  • Breaking

    The maximum hash length has been reduced to 22 characters

  • Breaking

    The RollupWarning type has been removed in favor of the RollupLog type

Changes to Rollup Options

  • Breaking

    Acorn plugins are no longer supported, the acornInjectPlugins option has been removed

  • Breaking

    The acorn option has been removed

  • Breaking

    output.externalImportAssertions has been deprecated in favor of output.externalImportAttributes

  • Breaking

    inlineDynamicImports, manualChunks and preserveModules have been removed on input option level: Please use the corresponding output options of the same names

  • Breaking

    Removed output options (#5143):

    • output.experimentalDeepDynamicChunkOptimization: This option is no longer needed as Rollup now always runs the full chunking algorithm

    • output.dynamicImportFunction: Use the renderDynamicImport plugin hook instead

    • output.namespaceToStringTag: Use output.generatedCode.symbols instead

    • output.preferConst: Use output.generatedCode.constBindings instead

Plugin API Changes

  • Breaking

    For this.resolve, the default of the skipSelf option is now true

  • Breaking

    this.parse now only supports the allowReturnOutsideFunction option for now

  • Breaking

    Import assertions now use the new import attribute AST structure

  • Breaking

    "assertions" have been replaced with "attributes" in various places of the plugin interface

  • Breaking

    If the import of a module id is handled by the load hook of a plugin, rollup.watch no longer watches the actual file if the module id corresponds to a real path; if this is intended, then the plugin is responsible for calling this.addWatchFile for any dependency files

  • Breaking

    The normalized input options provided by buildStart and other hooks no longer contain an onwarn handler; plugins should use onLog instead

  • Breaking

    this.moduleIds has been removed from the plugin context: Use this.getModuleIds() instead

  • Breaking

    The hasModuleSideEffects flag has been removed from the ModuleInfo returned by thi s.getModuleInfo(): Use moduleSideEffects on the ModuleInfo instead

Features

  • Improve parsing speed by switching to a native SWC-based parser

  • Rollup will now warn for @__PURE__ and @__NO_SIDE_EFFECTS__ annotations in invalid locations

  • The parser is now exposed as a separate export parseAst

Bug Fixes

  • Rollup no longer tries to watch virtual files if their name corresponds to an actual file name; instead, plugins handle watching via this.addWatchFile()

Pull Requests

  • Switch parser to SWC and introduce native/WASM code

  • Set the default of skipSelf to true

  • Removed

    Remove deprecated features

  • Imporve the performance of generating ast and rollup ast nodes

  • Removed

    Remove onwarn from normalized input options

  • Do not watch files anymore if their content is returned by the load hook

  • Add parse option to allow return outside function

  • Implement hashing content in Rust

  • Handle empty exports

  • Preserve shebang in entry module for CJS and ESM outputs

  • Also strip BOM from code strings in JS

  • Warn for invalid annotations

  • Ensure we support new import attribute "with" syntax

  • Expose parser

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.