A Rollup plugin to remove assertion calls from production bundles using Unassert. Current stable version is 2.0.0, released with Unassert 2.0.0. Release cadence is low; v1 used Unassert 1.6.0. It strips assert, power-assert, and custom assertion statements, reducing bundle size and avoiding runtime assertions in production. Key differentiator: integrates Unassert's removal logic directly into the Rollup build pipeline, supporting include/exclude patterns, sourcemaps, and custom assertion patterns.
npm install unassert-rollup-pluginVerified import paths — ran on the pinned version, not inferred.
Rollup configuration using unassert plugin to remove assertion calls, with inclusion/exclusion patterns and sourcemap support.
Review Unassert 2.0.0 changelog for changes to assertion patterns and require/import handling.
Set 'include' to '**/*.ts' or similar if using TypeScript.
Always use named import: import { unassert } from 'unassert-rollup-plugin';Keep sourcemap: true (default) to maintain debug ability.
Change to: import { unassert } from 'unassert-rollup-plugin';Run: npm install -D unassert-rollup-plugin