Skip to main content

babel-plugin-conditional-invariant

Build Status npm version npm deps

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

// Inputinvariant(value === false, 'Value must be falsy!');
// Outputif (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 12.17+

Index

Functions