Package detail

babel-plugin-transform-dev

martinandert65.7kMIT2.0.1

A plugin for Babel v6 which replaces __DEV__ with the result of evaluating 'production' !== process.env.NODE_ENV.

babel-plugin, transform, dev, debug

readme

babel-plugin-transform-dev

build status npm version

Replaces all occurrences of __DEV__ in your JavaScript code with the result of evaluating "production" !== process.env.NODE_ENV.

In order to replace __ENV__ with just "production" !== process.env.NODE_ENV, set the plugin's evaluate option to false.

Installation

$ npm install babel-plugin-transform-dev

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["transform-dev"]
}

Via CLI

$ babel --plugins transform-dev script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["transform-dev"]
});

Contributing

  1. Fork it ( https://github.com/martinandert/babel-plugin-transform-dev )
  2. Run npm install to install dependencies.
  3. Run the tests. We only take pull requests with passing tests, and it's great to know that you have a clean slate: npm test.
  4. Create your feature branch (git checkout -b my-new-feature)
  5. Add a test for your change. Only refactoring and documentation changes require no new tests. If you are adding functionality or are fixing a bug, we need a test!
  6. Make the test pass.
  7. Commit your changes (git commit -am 'add some feature')
  8. Push to your fork (git push origin my-new-feature)
  9. Create a new Pull Request

License

Released under The MIT License.

changelog

Changelog

Tags:

  • [New Feature]
  • [Bug Fix]
  • [Breaking Change]
  • [Documentation]
  • [Internal]
  • [Polish]

2.0.0 (December 3, 2015)

  • Breaking Change
    • Replace __ENV__ with the result of evaluating "production" !== process.env.NODE_ENV
  • Internal
    • Don't run tests twice in before release hook

1.1.1 (December 2, 2015)

  • Internal
    • Add release helpers as npm run scripts to package.json
    • Employ best practices in package.json
    • Don't let the plugin's babel settings polute the tests

1.1.0 (November 29, 2015)

  • New Feature
    • Add evaluate option

1.0.0 (November 29, 2015)

First public release.