{"id":22270,"library":"rollup-plugin-unassert","title":"rollup-plugin-unassert","description":"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.","status":"maintenance","version":"0.6.0","language":"javascript","source_language":"en","source_url":"https://github.com/mourner/rollup-plugin-unassert","tags":["javascript","rollup","rollup-plugin","unassert"],"install":[{"cmd":"npm install rollup-plugin-unassert","lang":"bash","label":"npm"},{"cmd":"yarn add rollup-plugin-unassert","lang":"bash","label":"yarn"},{"cmd":"pnpm add rollup-plugin-unassert","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency for Rollup plugin system.","package":"rollup","optional":false},{"reason":"Core dependency providing assertion removal logic.","package":"unassert","optional":false}],"imports":[{"note":"ESM-only; CJS require works but may cause issues with Rollup's plugin resolution.","wrong":"const unassert = require('rollup-plugin-unassert')","symbol":"unassert","correct":"import unassert from 'rollup-plugin-unassert'"},{"note":"Default export only; named import does not exist.","wrong":"import { unassert } from 'rollup-plugin-unassert'","symbol":"default import","correct":"import unassert from 'rollup-plugin-unassert'"},{"note":"Types are not bundled; you may need to define your own or use @types.","symbol":"TypeScript type (if needed)","correct":"import type { RollupPluginUnassertOptions } from 'rollup-plugin-unassert'"}],"quickstart":{"code":"import unassert from 'rollup-plugin-unassert';\n\nexport default {\n  input: 'src/index.js',\n  output: {\n    file: 'dist/bundle.js',\n    format: 'esm'\n  },\n  plugins: [\n    unassert()\n  ]\n};","lang":"javascript","description":"Basic Rollup config with rollup-plugin-unassert to remove assertion calls from build output."},"warnings":[{"fix":"Conditionally add plugin based on process.env.NODE_ENV or similar.","message":"The plugin removes assertion calls only in production builds; during development assertions remain. Ensure it is used in production config only.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Do not set sourcemap: false unless you understand the debugging tradeoff.","message":"Sourcemap support: setting sourcemap: false hides assert calls when debugging. Leave as default true to keep sourcemaps accurate.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Evaluate alternatives like babel-plugin-unassert or manual removal.","message":"Package is in maintenance mode; no active development. Consider using a more actively maintained alternative.","severity":"deprecated","affected_versions":">=0.6.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"npm install --save-dev rollup-plugin-unassert","cause":"Missing local installation or incorrect import path.","error":"Error: Cannot find module 'rollup-plugin-unassert'"},{"fix":"Use import unassert from 'rollup-plugin-unassert' (without curly braces).","cause":"Using named import instead of default import.","error":"TypeError: unassert is not a function"},{"fix":"Ensure unassert is installed as a dependency: npm install unassert","cause":"Unassert internal dependency not resolved; Rollup may fail if not installed.","error":"! RollupError: Could not resolve 'unassert' from ..."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}