Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-transform-dev

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-transform-dev

A plugin for Babel v6 which replaces `__DEV__` with `'production' !== process.env.NODE_ENV`.

  • 1.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.4K
increased by6.99%
Maintainers
1
Weekly downloads
 
Created
Source

babel-plugin-transform-dev

build status npm version

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

Make sure to put this plugin before other plugins that might transform process.env.

You can also set the plugin's evaluate option to true in order to replace __ENV__ with the result of evaluating "production" !== process.env.NODE_ENV at build time.

Installation

$ npm install babel-plugin-transform-dev

Usage

.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.

Keywords

FAQs

Package last updated on 02 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc