babel-preset-kyt-react
Advanced tools
Comparing version 1.0.0-alpha.ae7ae43d to 1.0.0-alpha.b1960b09
var babelPresetReact = require('@babel/preset-react'); | ||
var addReactDisplayName = require('babel-plugin-add-react-displayname'); | ||
var reactRemovePropTypes = require('babel-plugin-transform-react-remove-prop-types'); | ||
@@ -8,4 +9,19 @@ var reactTransformConstant = require('@babel/plugin-transform-react-constant-elements'); | ||
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 { | ||
plugins: [addReactDisplayName], | ||
env: { | ||
@@ -32,3 +48,3 @@ development: { | ||
], | ||
plugins: [reactRemovePropTypes, reactTransformConstant, reactTransformInline], | ||
plugins: productionTransforms, | ||
}, | ||
@@ -35,0 +51,0 @@ }, |
{ | ||
"name": "babel-preset-kyt-react", | ||
"version": "1.0.0-alpha.ae7ae43d", | ||
"version": "1.0.0-alpha.b1960b09", | ||
"description": "An opinionated babel preset for react apps, best used with kyt.", | ||
@@ -15,4 +15,5 @@ "main": "lib/index.js", | ||
"@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.ae7ae43d" | ||
"babel-preset-kyt-core": "1.0.0-alpha.b1960b09" | ||
}, | ||
@@ -19,0 +20,0 @@ "keywords": [ |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
4000
46
0
6
+ Addedbabel-plugin-add-react-displayname@0.0.5(transitive)
+ Addedbabel-preset-kyt-core@1.0.0-alpha.b1960b09(transitive)
+ Addedlodash.merge@4.6.1(transitive)
- Removedbabel-preset-kyt-core@1.0.0-alpha.ae7ae43d(transitive)