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

babel-plugin-react-transform

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-react-transform - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

lib/actions/dragDrop.js

4

lib/index.js

@@ -105,4 +105,4 @@ 'use strict';

var pluginOptions = file.opts.extra['react-transform'];
if (!Array.isArray(pluginOptions) || pluginOptions.length === 0) {
throw new Error('babel-plugin-react-transform requires that you specify ' + 'extras["react-transform"] in .babelrc ' + 'or in your Babel Node API call options, and that it is an array ' + 'with more than zero elements.');
if (!Array.isArray(pluginOptions)) {
throw new Error('babel-plugin-react-transform requires that you specify ' + 'extras["react-transform"] in .babelrc ' + 'or in your Babel Node API call options, and that it is an array.');
}

@@ -109,0 +109,0 @@ return pluginOptions;

{
"name": "babel-plugin-react-transform",
"version": "1.0.3",
"version": "1.0.4",
"description": "Babel plugin to instrument React components with custom transforms",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -46,21 +46,31 @@ # babel-plugin-react-transform

"stage": 0,
"plugins": [
"react-transform"
],
"extra": {
// must be defined and be an array
"react-transform": [{
// can be an NPM module name or a local path
"target": "react-transform-webpack-hmr",
// see specific transform's docs for "imports" and "locals" it needs
"imports": ["react"],
"locals": ["module"]
}, {
// you can have many transforms, not just one
"target": "react-transform-catch-errors",
"imports": ["react", "redbox-react"]
}, {
// can be an NPM module name or a local path
"target": "./src/my-custom-transform"
}]
"env": {
// this plugin will be included only in development mode, e.g.
// if NODE_ENV (or BABEL_ENV) environment variable is not set
// or is equal to "development"
"development": {
"plugins": [
// Include babel-plugin-react-display-name if you’re
// using React.createClass() *before* react-transform:
// "react-display-name",
"react-transform"
],
"extra": {
// must be defined and be an array
"react-transform": [{
// can be an NPM module name or a local path
"target": "react-transform-webpack-hmr",
// see specific transform's docs for "imports" and "locals" it needs
"imports": ["react"],
"locals": ["module"]
}, {
// you can have many transforms, not just one
"target": "react-transform-catch-errors",
"imports": ["react", "redbox-react"]
}, {
// can be an NPM module name or a local path
"target": "./src/my-custom-transform"
}]
}
}
}

@@ -196,2 +206,4 @@ }

When using `React.createClass()` and allowing `babel` to extract the `displayName` property you must ensure that [babel-plugin-react-display-name](https://github.com/babel/babel/tree/development/packages/babel-plugin-react-display-name) is included before `react-transform`. See [this github issue](https://github.com/gaearon/babel-plugin-react-transform/issues/19) for more details.
## Discussion

@@ -198,0 +210,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