0.2.3 • Published 4 years ago

babel-plugin-dev-expression v0.2.3

Weekly downloads
85,615
License
MIT
Repository
github
Last release
4 years ago

babel-plugin-dev-expression npm version

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'

Note: The dev-expression transform does not run when NODE_ENV is test. As such, if you use __DEV__, you will need to define it as a global constant in your test environment.

invariant

Replaces

invariant(condition, argument, argument);

with

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

Recommended for use with https://github.com/zertosh/invariant or smaller https://github.com/alexreardon/tiny-invariant.

warning

Replaces

warning(condition, argument, argument);

with

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

Recommended for use with https://github.com/r3dm/warning or smaller https://github.com/alexreardon/tiny-warning.

tsdx-extraisotone-preset-reactbabel-preset-react-native-web-exporeactcloud-dev-serverreactcloud-webpackgql_din_modbabel-preset-hiroelectron-react-toolseparts-shared-uicra-template-smart@infinitebrahmanuniverse/nolb-babel-plugin-doerlikon-toolsexport-tsexpand-react-bridge@everything-registry/sub-chunk-1201@leijingdao/tsdxwebchexm-uixm-webpack-configtestapautsdxvoluptatesporro@dji-dev/us-web-config@donapot/mylibtest@cryptocode99/token-lists@commercetools-frontend/babel-preset-mc-app@cute-apocalypse/react-tree@copart/babel-preset-ops-core@copart/g2-ops-server@copart/lot-search-components@copart/ops-app-frame@copart/ops-local-storage@developertown/tsdx@percent/percent-api-hookssushi-sdk-ftmstub-citystub-villagesurfwaxttsdx@ambroseus/tsdx@anolilab/babel-preset@asheswook/react-router@autoguru/babel-preset@ali-i18n-fe/dada-cli@ali-i18n-fe/dada-component@behzadebrhm/utils@bezael-challenge/innoit-date-format@bluelovers/tsdx@bhzdbash/utils@breakinferno/tsdxf@chance/tsdx@4c/babel-preset@4c/babel-preset-4catalyzer@abdulkaderptp/tsdx@dfds-ui/scriptstsdxtsdx-esmtsdx-sasstsdx-with-svgtsdx2tsdxwtsdyts3x@dudadev/duda-ui@htv/ui-kit@hproinformatica/functions@humanity.cash/types@gbozee/tsdx@gomah/tsdx@eliteswap/token-lists@inst-app/babel-preset-esx@laconic/rollup-script@kiwicom/babel-preset@inti-ar/evm-chains@lgfe/ls-template-cli-babel-preset@lgfe/ls-template-cli-rollup-script@lunde/babel-preset-es@meysam213/react-leaflet@massivepixel/use-query@neuraiproject/chains@nemethricsi/reach-ui@neat-preset/babel@n3tr/tsdx@nathanvale/babel-preset@epigraph/epigraph-analytics@ewtp-dada/ewtp-dada-cli@moln/tsdx@maujzs/branch-release@jbrowse/development-tools@jaredlunde/babel-preset-esx@jarrku/foreach-tsdx@johnrom/tsdx@dvaji/tsdx@react-bootstrap/babel-preset@qandq/plugins-common@prismify/tsdx@projectbabelfish/defikingdoms-sdk@reactions/router@reactizer/babel-preset@obstinate/rollup-script
0.2.3

4 years ago

0.2.2

6 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.0

10 years ago