JSPM

babel-plugin-dev-expression

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 140265
  • Score
    100M100P100Q168172F
  • License BSD-3-Clause

A mirror of Facebook's dev-expression Babel plugin

Package Exports

  • babel-plugin-dev-expression

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (babel-plugin-dev-expression) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

babel-plugin-dev-expression

A mirror of Facebook's dev-expression Babel plugin.

This plugin reduces or eliminates development checks from production code.

__DEV__

Replaces

__DEV__

with

process.env.NODE_ENV !== 'production'

invariant

Replaces

invariant(condition, argument, argument);

with

if (!condition) {
  if ("production" !== process.env.NODE_ENV) {
    invariant(false, argument, argument);
  } else {
    invariant(false);
  }
}

warning

Replaces

warning(condition, argument, argument);

with

if ("production" !== process.env.NODE_ENV) {
  warning(condition, argument, argument);
}