Rollup plugin to remove assertion calls (e.g., assert, console.assert) from bundles using Unassert. Current stable version: 0.6.0. Low release cadence (last release 2020). Key differentiator: integrates Unassert into Rollup builds, removing debug assertions from production code, improving bundle size and performance. Alternatives like babel-plugin-unassert require Babel; this plugin is Rollup-native.
npm install rollup-plugin-unassertVerified import paths — ran on the pinned version, not inferred.
Basic Rollup config with rollup-plugin-unassert to remove assertion calls from build output.
Conditionally add plugin based on process.env.NODE_ENV or similar.
Do not set sourcemap: false unless you understand the debugging tradeoff.
Evaluate alternatives like babel-plugin-unassert or manual removal.
npm install --save-dev rollup-plugin-unassert
Use import unassert from 'rollup-plugin-unassert' (without curly braces).
Ensure unassert is installed as a dependency: npm install unassert