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

babel-preset-kyt-react

Package Overview
Dependencies
Maintainers
3
Versions
258
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-preset-kyt-react - npm Package Compare versions

Comparing version 1.0.0-alpha.8a16cb19 to 1.0.0-alpha.8a69a26a

48

lib/index.js

@@ -1,22 +0,48 @@

var babelPresetReact = require('babel-preset-react');
var babelPresetReact = require('@babel/preset-react');
var addReactDisplayName = require('babel-plugin-add-react-displayname');
var reactRemovePropTypes = require('babel-plugin-transform-react-remove-prop-types');
var reactTransformConstant = require('babel-plugin-transform-react-constant-elements');
var reactTransformInline = require('babel-plugin-transform-react-inline-elements');
var reactTransformJsxSource = require('babel-plugin-transform-react-jsx-source');
var reactTransformConstant = require('@babel/plugin-transform-react-constant-elements');
var reactTransformInline = require('@babel/plugin-transform-react-inline-elements');
var babelPresetKytCore = require('babel-preset-kyt-core');
module.exports = function getPresetReact(context, opts) {
var useProductionTransforms = true;
var productionTransforms = [reactRemovePropTypes];
opts = opts || {};
if ('useProductionTransforms' in opts) {
// eslint-disable-next-line prefer-destructuring
useProductionTransforms = opts.useProductionTransforms;
}
if (useProductionTransforms === true) {
productionTransforms.push(reactTransformConstant);
productionTransforms.push(reactTransformInline);
}
return {
presets: [
babelPresetReact,
// pass options through to core preset
[babelPresetKytCore, opts || {}],
],
plugins: [addReactDisplayName],
env: {
development: {
plugins: [reactTransformJsxSource],
presets: [
[babelPresetReact, { development: true }],
// pass options through to core preset
[babelPresetKytCore, opts || {}],
],
},
test: {
presets: [
babelPresetReact,
// pass options through to core preset
[babelPresetKytCore, opts || {}],
],
},
production: {
plugins: [reactRemovePropTypes, reactTransformConstant, reactTransformInline],
presets: [
babelPresetReact,
// pass options through to core preset
[babelPresetKytCore, opts || {}],
],
plugins: productionTransforms,
},

@@ -23,0 +49,0 @@ },

{
"name": "babel-preset-kyt-react",
"version": "1.0.0-alpha.8a16cb19",
"version": "1.0.0-alpha.8a69a26a",
"description": "An opinionated babel preset for react apps, best used with kyt.",

@@ -12,8 +12,8 @@ "main": "lib/index.js",

"dependencies": {
"babel-plugin-transform-react-constant-elements": "6.9.1",
"babel-plugin-transform-react-inline-elements": "6.8.0",
"babel-plugin-transform-react-jsx-source": "6.9.0",
"babel-plugin-transform-react-remove-prop-types": "0.2.10",
"babel-preset-kyt-core": "0.3.0",
"babel-preset-react": "6.16.0"
"@babel/plugin-transform-react-constant-elements": "7.2.0",
"@babel/plugin-transform-react-inline-elements": "7.2.0",
"@babel/preset-react": "7.0.0",
"babel-plugin-add-react-displayname": "0.0.5",
"babel-plugin-transform-react-remove-prop-types": "0.4.21",
"babel-preset-kyt-core": "1.0.0-alpha.8a69a26a"
},

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

@@ -10,4 +10,6 @@ ## babel-preset-kyt-react

To use in your project:
1. `npm install babel-preset-kyt-react --save`
2. In your .babelrc:
```

@@ -23,3 +25,3 @@ {

*(see [documentation](https://babeljs.io/docs/plugins/#plugin-preset-options) for Babel preset options)*
_(see [documentation](https://babeljs.io/docs/plugins/#plugin-preset-options) for Babel preset options)_

@@ -26,0 +28,0 @@ - `envOptions` (`Object`)- pass down babel-preset-env options to babel-preset-kyt-core. See more in the `envOptions` [kyt-core documentation](/packages/babel-preset-kyt-core/README.md#options).

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