babel-preset-steezy
Advanced tools
Comparing version 0.1.0-alpha.dc1f53d4 to 0.1.0
76
index.js
@@ -1,39 +0,45 @@ | ||
"use strict" | ||
module.exports = function () { | ||
const path = require('path') | ||
var preset = { | ||
presets: [ | ||
require.resolve("@babel/preset-env"), | ||
require.resolve("@babel/preset-react") | ||
], | ||
plugins: [ | ||
require.resolve("@babel/plugin-syntax-dynamic-import"), | ||
require.resolve("@babel/plugin-proposal-class-properties"), | ||
[ | ||
require.resolve("@babel/plugin-proposal-object-rest-spread", { | ||
useBuiltIns: true | ||
}) | ||
const preset = { | ||
presets: [ | ||
[ | ||
require.resolve('@babel/preset-env'), | ||
{ | ||
targets: { | ||
node: 'current' | ||
}, | ||
modules: false | ||
} | ||
] | ||
], | ||
plugins: [ | ||
require.resolve('@babel/plugin-proposal-class-properties'), | ||
[ | ||
require.resolve('@babel/plugin-proposal-object-rest-spread'), { | ||
useBuiltIns: true | ||
} | ||
], | ||
[ | ||
require.resolve('@babel/plugin-transform-runtime'), { | ||
helpers: false, | ||
polyfill: false, | ||
regenerator: true, | ||
moduleName: path.dirname(require.resolve('@babel/runtime/package')) | ||
} | ||
] | ||
] | ||
] | ||
} | ||
} | ||
if (process.env.NODE_ENV === 'test') { | ||
preset.plugins.push(preset.plugins, [ | ||
require.resolve('@babel/plugin-transform-parameters'), | ||
[ | ||
require.resolve('@babel/plugin-transform-modules-commonjs'), { | ||
loose: true | ||
} | ||
] | ||
]) | ||
} | ||
var env = process.env.NODE_ENV | ||
if (env !== "development" && env !== "test" && env !== "production") { | ||
throw new Error(`🚫 NODE_ENV must be specified`) | ||
return preset | ||
} | ||
if (env === "test") { | ||
preset.plugins.push(preset.plugins, [ | ||
[ | ||
require.resolve("@babel/plugin-transform-modules-commonjs", { | ||
loose: true | ||
}) | ||
] | ||
]) | ||
} | ||
if (env === "production") { | ||
preset.plugins.push(preset.plugins, [ | ||
require.resolve("@babel/plugin-transform-react-inline-elements"), | ||
require.resolve("@babel/plugin-transform-react-constant-elements") | ||
]) | ||
} |
{ | ||
"name": "babel-preset-steezy", | ||
"version": "0.1.0-alpha.dc1f53d4", | ||
"main": "index.js", | ||
"version": "0.1.0", | ||
"description": "babel preset for steezy apps", | ||
"repository": "https://github.com/gretzky/steezy", | ||
"files": [ | ||
"index.js" | ||
], | ||
"license": "MIT", | ||
"keywords": [ | ||
"babel", | ||
"babel7", | ||
"es6", | ||
"node", | ||
"nodejs", | ||
"steezy" | ||
], | ||
"dependencies": { | ||
@@ -7,0 +19,0 @@ "@babel/core": "^7.0.0-beta.40", |
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
43
1895
4