Registry / devops / rollup-plugin-unassert

rollup-plugin-unassert

JSON →
library0.6.0jsnpmunverified

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-unassert
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-UNAS
R
rollup-plugin-unassert
devopsjavascriptv0.6.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

unassert
import unassert from 'rollup-plugin-unassert'
const unassert = require('rollup-plugin-unassert')
ESM-only; CJS require works but may cause issues with Rollup's plugin resolution.
default import
import unassert from 'rollup-plugin-unassert'
import { unassert } from 'rollup-plugin-unassert'
Default export only; named import does not exist.
TypeScript type (if needed)
import type { RollupPluginUnassertOptions } from 'rollup-plugin-unassert'
Types are not bundled; you may need to define your own or use @types.

Basic Rollup config with rollup-plugin-unassert to remove assertion calls from build output.

import unassert from 'rollup-plugin-unassert'; export default { input: 'src/index.js', output: { file: 'dist/bundle.js', format: 'esm' }, plugins: [ unassert() ] };
Debug
Known issues
gotchaThe plugin removes assertion calls only in production builds; during development assertions remain. Ensure it is used in production config only.
fix
Conditionally add plugin based on process.env.NODE_ENV or similar.
affects: >=0.0.0
gotchaSourcemap support: setting sourcemap: false hides assert calls when debugging. Leave as default true to keep sourcemaps accurate.
fix
Do not set sourcemap: false unless you understand the debugging tradeoff.
affects: >=0.0.0
deprecatedPackage is in maintenance mode; no active development. Consider using a more actively maintained alternative.
fix
Evaluate alternatives like babel-plugin-unassert or manual removal.
affects: >=0.6.0
Errors
Common errors & fixes
Error: Cannot find module 'rollup-plugin-unassert'
Missing local installation or incorrect import path.
fix
npm install --save-dev rollup-plugin-unassert
TypeError: unassert is not a function
Using named import instead of default import.
fix
Use import unassert from 'rollup-plugin-unassert' (without curly braces).
! RollupError: Could not resolve 'unassert' from ...
Unassert internal dependency not resolved; Rollup may fail if not installed.
fix
Ensure unassert is installed as a dependency: npm install unassert
Upgrade
Version history
0.6.0latest on npm
Audit
Dependencies
rolluprequiredPeer dependency for Rollup plugin system.
unassertrequiredCore dependency providing assertion removal logic.
Agent activity
8 hits · last 30 days
node
8
Resources
rollup-plugin-unassert — npm install rollup-plugin-unassert · libregistry