rollup
4.68.5 · 17 Nov 2026MIT170.6M / weekRepositoryHomepagenpmAtom feed
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-nodepackage 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_ASSERTIONerror code has been replaced withINVALID_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 foresandcjsformats - Breaking
File hashes will now use url-safe base64 encoded hashes
Security
2 advisories affect 4.0.0; 4.59.0 fixes them
- HighRollup 4 has Arbitrary File Write via Path TraversalGHSA-mw96-cpmx-2vgc · 25 Feb 2026Fixed in 4.59.0
- HighDOM Clobbering Gadget found in rollup bundled scripts that leads to XSSGHSA-gcx4-mw62-g8wm · 23 Sep 2024Fixed in 4.22.4
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-nodepackage 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_ASSERTIONerror code has been replaced withINVALID_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 foresandcjsformats - Breaking
File hashes will now use url-safe base64 encoded hashes
- Breaking
The maximum hash length has been reduced to 22 characters
- Breaking
The
RollupWarningtype has been removed in favor of theRollupLogtype
Changes to Rollup Options
- Breaking
Acorn plugins are no longer supported, the
acornInjectPluginsoption has been removed - Breaking
The
acornoption has been removed - Breaking
output.externalImportAssertionshas been deprecated in favor ofoutput.externalImportAttributes - Breaking
inlineDynamicImports,manualChunksandpreserveModuleshave 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 algorithmoutput.dynamicImportFunction: Use therenderDynamicImportplugin hook insteadoutput.namespaceToStringTag: Useoutput.generatedCode.symbolsinsteadoutput.preferConst: Useoutput.generatedCode.constBindingsinstead
Plugin API Changes
- Breaking
For
this.resolve, the default of theskipSelfoption is nowtrue - Breaking
this.parsenow only supports theallowReturnOutsideFunctionoption 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
loadhook of a plugin,rollup.watchno longer watches the actual file if the module id corresponds to a real path; if this is intended, then the plugin is responsible for callingthis.addWatchFilefor any dependency files - Breaking
The normalized input options provided by
buildStartand other hooks no longer contain anonwarnhandler; plugins should useonLoginstead - Breaking
this.moduleIdshas been removed from the plugin context: Usethis.getModuleIds()instead - Breaking
The
hasModuleSideEffectsflag has been removed from theModuleInforeturned bythi s.getModuleInfo(): UsemoduleSideEffectson theModuleInfoinstead
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 locationsThe 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.