Rollup preserveEntrySignatures behavior across major versions
0 reputation · 11 Apr 2021, 17:05 UTC
Side-by-side Rollup entry points during migration
Goal: emit an existing application bundle and a replacement bundle from one Rollup build, serve both from the same origin without server downtime, and load the new entry only for selected routes using dynamic import().
Constraint: preserveEntrySignatures controls whether an entry point re-exports all chunk exports, only its own exports, allows extension, or disables preservation. The default and exact export semantics changed across Rollup major versions, making entry-point compatibility version-sensitive. External dependencies stay unresolved and must be provided at runtime, which affects whether esm, cjs, or iife output suits the migration target. Rollup does not switch traffic between bundles.
Open questions
- Which preserveEntrySignatures value keeps the old entry's public API intact while exposing the new entry independently?
- What is the preserveEntrySignatures default for the installed Rollup major version?
- How should external runtime dependencies be declared so both bundles load without conflicts?