Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

rollup-plugin-deassert

RebeccaStevens3.5kBSD-3-Clause1.3.0TypeScript support: included

rollup plugin for deassert

assert, deassert, invariant, unassert, rollup, rollup-plugin

readme

Rollup Plugin Deassert

npm version CI Coverage Status\ code style: prettier GitHub Discussions BSD 3 Clause license Commitizen friendly semantic-release

Any donations would be much appreciated. 😄

Enterprise Users

deassert is available as part of the Tidelift Subscription.

Tidelift is working with the maintainers of deassert and a growing network of open source maintainers to ensure your open source software supply chain meets enterprise standards now and into the future. Learn more.

Installation

# Install with npm
npm install -D rollup-plugin-deassert

# Install with pnpm
pnpm add -D rollup-plugin-deassert

# Install with yarn
yarn add -D rollup-plugin-deassert

# Install with bun
bun add -D rollup-plugin-deassert

Usage

You probably don't want to use this library in your development builds. It's designed to be used in your production builds.

// rollup.config.js
import { rollupPlugin as deassert } from "deassert";

const isProduction = process.env.NODE_ENV === "production";

export default {
  // ...
  plugins: isProduction
    ? [
        // ...
        deassert({
          include: ["**/*.ts"], // If using TypeScript, be sure to include this config option. Otherwise remove it.
        }),
      ]
    : [
        // ...
      ],
};