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

babel-preset-o

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-preset-o - npm Package Compare versions

Comparing version 0.1.3 to 0.2.0

49

index.js
const path = require('path')
const isDev = process.env.NODE_ENV === 'development'
module.exports = (api, options = {}) => {
const nodeEnv = process.env.NODE_ENV
const isDev = nodeEnv === 'development'
module.exports = () => {
let absoluteRuntime = null
try {
absoluteRuntime = path.dirname(
require.resolve('@babel/runtime/package.json')
)
} catch (_) {}
const {
nodeVersion = 'current',
modules = false,
useBuiltIns = false,
} = options
return {

@@ -13,7 +27,9 @@ presets: [

loose: true,
useBuiltIns: isDev && 'usage',
corejs: useBuiltIns ? 3 : false,
modules,
useBuiltIns,
targets: {
node: 'current',
esmodules: true,
node: nodeVersion,
},
exclude: ['@babel/plugin-transform-typeof-symbol'],
},

@@ -27,2 +43,13 @@ ],

],
isDev && [
require('@babel/plugin-transform-runtime').default,
{
corejs: false,
helpers: isDev,
regenerator: true,
useESModules: false,
version: require('@babel/runtime/package.json').version,
absoluteRuntime,
}
],
[

@@ -33,13 +60,7 @@ require("@babel/plugin-proposal-optional-chaining").default,

[
require('@babel/plugin-transform-runtime').default,
{
regenerator: true,
version: require('@babel/runtime/package.json').version,
absoluteRuntime: path.dirname(
require.resolve('@babel/runtime/package.json')
),
}
require("@babel/plugin-proposal-nullish-coalescing-operator").default,
{ loose: true },
]
],
].filter(Boolean),
};
};
{
"name": "babel-preset-o",
"version": "0.1.3",
"version": "0.2.0",
"description": "tiny and flexible babel preset",

@@ -12,2 +12,3 @@ "main": "index.js",

"@babel/plugin-proposal-class-properties": "7.12.1",
"@babel/plugin-proposal-nullish-coalescing-operator": "7.12.1",
"@babel/plugin-proposal-optional-chaining": "7.12.7",

@@ -14,0 +15,0 @@ "@babel/plugin-transform-runtime": "7.12.10",

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