Nanometer Process Machine

    babel-plugin-conditional-invariant
    TypeScript icon, indicating that this package has built-in type declarations

    2.0.2 • Public • Published

    babel-plugin-conditional-invariant

    Build Status npm version

    Wrap invariant function checks in process.env.NODE_ENV conditionals that only run in development.

    // Input
    invariant(value === false, 'Value must be falsy!');
    // Output
    if (process.env.NODE_ENV !== 'production') {
      invariant(value === false, 'Value must be falsy!');
    }

    Installation

    yarn add --dev babel-plugin-conditional-invariant
    

    Add the plugin to your root babel.config.* file.

    module.exports = {
      plugins: ['babel-plugin-conditional-invariant'],
    };

    Requirements

    • Linux, OSX, Windows
    • Node 14.15+

    Install

    npm i babel-plugin-conditional-invariant

    DownloadsWeekly Downloads

    502

    Version

    2.0.2

    License

    MIT

    Unpacked Size

    10.5 kB

    Total Files

    7

    Last publish

    Collaborators

    • milesj