@ta-interaktiv/babel-preset-react-component
Advanced tools
Comparing version 0.1.5 to 0.1.6
@@ -0,1 +1,9 @@ | ||
<a name="0.1.6"></a> | ||
## [0.1.6](https://gitlab.com/ta-interaktiv/modules/babel-preset-react-component/compare/v0.1.5...v0.1.6) (2018-02-15) | ||
### Bug Fixes | ||
* turn into a function ([2f82367](https://gitlab.com/ta-interaktiv/modules/babel-preset-react-component/commit/2f82367)) | ||
<a name="0.1.5"></a> | ||
@@ -2,0 +10,0 @@ |
53
index.js
@@ -1,30 +0,35 @@ | ||
// Define in what environment we are | ||
var env = process.env.BABEL_ENV || process.env.NODE_ENV || 'default' | ||
module.exports = function () { | ||
// Define in what environment we are | ||
var env = process.env.BABEL_ENV || process.env.NODE_ENV || 'default' | ||
var presets = [require('babel-preset-react')] | ||
var plugins = [require('babel-plugin-transform-class-properties'), require('babel-plugin-transform-object-rest-spread')] | ||
var presets = [require('babel-preset-react')] | ||
var plugins = [ | ||
require('babel-plugin-transform-class-properties'), | ||
require('babel-plugin-transform-object-rest-spread') | ||
] | ||
if (env === 'test') { | ||
presets.push([require('babel-preset-env'), { targets: { node: true } }]) | ||
} | ||
if (env === 'test') { | ||
presets.push([require('babel-preset-env'), { targets: { node: true } }]) | ||
} | ||
// Default is CommonJS | ||
if (env === 'default' || env === 'commonjs') { | ||
presets.push([ | ||
require('babel-preset-env'), | ||
{ modules: 'commonjs', useBuiltIns: false } | ||
]) | ||
} | ||
// Default is CommonJS | ||
if (env === 'default' || env === 'commonjs') { | ||
presets.push([ | ||
require('babel-preset-env'), | ||
{ modules: 'commonjs', useBuiltIns: false } | ||
]) | ||
} | ||
// For modern ECMA Script | ||
if (env === 'es') { | ||
presets.push([ | ||
require('babel-preset-env'), | ||
{ modules: false, useBuiltIns: false } | ||
]) | ||
} | ||
// For modern ECMA Script | ||
if (env === 'es') { | ||
presets.push([ | ||
require('babel-preset-env'), | ||
{ modules: false, useBuiltIns: false } | ||
]) | ||
} | ||
module.exports = { | ||
presets: presets, | ||
plugins: plugins | ||
return { | ||
presets: presets, | ||
plugins: plugins | ||
} | ||
} |
{ | ||
"name": "@ta-interaktiv/babel-preset-react-component", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "Babel preset for developing reusable React components.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
112933
30