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.0 to 1.0.1

CODE_OF_CONDUCT.md

8

lib/index.js

@@ -24,3 +24,3 @@ 'use strict';

if (specifiedPath[0] === '.') {
throw new Error('Relative path like ' + specifiedPath + ' is only allowed if ' + 'babel-plugin-wrap-react-components is inside a node_modules folder.');
throw new Error('Relative path like ' + specifiedPath + ' is only allowed if ' + 'babel-plugin-react-transform is inside a node_modules folder.');
}

@@ -101,5 +101,5 @@ return specifiedPath;

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

@@ -194,3 +194,3 @@ return pluginOptions;

return new Plugin('babel-plugin-wrap-react-components', {
return new Plugin('babel-plugin-react-transform', {
visitor: {

@@ -197,0 +197,0 @@ Function: {

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

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

@@ -33,3 +33,3 @@ # babel-plugin-react-transform

Then edit your `.babelrc` to include `extra.babel-plugin-react-transform`.
Then edit your `.babelrc` to include `extra.react-transform`.
It must be an array of the transforms you want to use:

@@ -41,7 +41,7 @@

"plugins": [
"babel-plugin-react-transform"
"react-transform"
],
"extra": {
// must be defined and be an array
"babel-plugin-react-transform": [{
"react-transform": [{
// can be an NPM module name or a local path

@@ -48,0 +48,0 @@ "target": "react-transform-webpack-hmr",

@@ -20,3 +20,3 @@ import path from 'path';

extra: {
'babel-plugin-wrap-react-components': [{
'react-transform': [{
target: 'my-custom-module/wrap',

@@ -23,0 +23,0 @@ locals: ['module'],

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