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 - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

5

CHANGELOG.md

@@ -12,4 +12,9 @@ # Changelog

## 1.1.0 (November 29, 2015)
- **New Feature**
- Add `evaluate` option
## 1.0.0 (November 29, 2015)
First public release.

5

lib/index.js

@@ -11,3 +11,4 @@ 'use strict';

var expr = template('"production" !== process.env.NODE_ENV');
var expr = template('"production" !== process.env.NODE_ENV')();
var bool = t.booleanLiteral('production' !== process.env.NODE_ENV);

@@ -18,3 +19,3 @@ return {

if (t.isIdentifier(path.node, { name: '__DEV__' })) {
path.replaceWith(expr());
path.replaceWith(this.opts.evaluate ? bool : expr);
}

@@ -21,0 +22,0 @@ }

4

package.json
{
"name": "babel-plugin-transform-dev",
"version": "1.0.0",
"description": "A plugin for Babel v6 which replaces \"__DEV__\" with \"'production' !== process.env.NODE_ENV\".",
"version": "1.1.0",
"description": "A plugin for Babel v6 which replaces `__DEV__` with `'production' !== process.env.NODE_ENV`.",
"main": "lib/index.js",

@@ -6,0 +6,0 @@ "keywords": [

@@ -6,5 +6,9 @@ # babel-plugin-transform-dev

Replaces `__DEV__` with `process.env.NODE_ENV !== 'production'`.
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

@@ -11,0 +15,0 @@

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