Socket
Socket
Sign inDemoInstall

@babel/helper-compilation-targets

Package Overview
Dependencies
52
Maintainers
4
Versions
61
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/helper-compilation-targets

Helper functions on Babel compilation targets


Version published
Maintainers
4
Weekly downloads
29,410,883
decreased by-25.37%

Weekly downloads

Package description

What is @babel/helper-compilation-targets?

The @babel/helper-compilation-targets package is a helper utility used by Babel to determine which JavaScript language features need to be transformed based on the specified compilation targets, such as browsers or Node.js versions. It helps in generating the most efficient and compatible code for the specified environments.

What are @babel/helper-compilation-targets's main functionalities?

Determining necessary plugins/presets

This feature allows you to determine which Babel plugins or presets are necessary to transform your code based on the specified target environments, such as the last two versions of all browsers or Safari versions greater than 7.

const { default: getTargets, filterItems } = require('@babel/helper-compilation-targets');

const targets = getTargets({
  browsers: ['last 2 versions', 'safari > 7']
});

const plugins = filterItems(
  require('@babel/preset-env/data/plugins'),
  targets,
  { ignoreBrowserslistConfig: true }
);

Customizing target environments

This feature enables customization of the target environments for which you are compiling your code. For example, you can specify that you want to target environments that support ES modules or the current version of Node.js.

const { default: getTargets } = require('@babel/helper-compilation-targets');

const targets = getTargets({
  esmodules: true,
  node: 'current'
});

Other packages similar to @babel/helper-compilation-targets

Changelog

Source

v7.20.7 (2022-12-22)

:eyeglasses: Spec Compliance
  • babel-helper-member-expression-to-functions, babel-helper-replace-supers, babel-plugin-proposal-class-properties, babel-plugin-transform-classes
    • #15223 fix: Deleting super property should throw (@SuperSodaSea)
  • babel-helpers, babel-plugin-proposal-class-properties, babel-plugin-transform-classes, babel-plugin-transform-object-super
:bug: Bug Fix
  • babel-parser, babel-plugin-transform-typescript
  • babel-traverse
  • babel-plugin-transform-typescript, babel-traverse
  • babel-plugin-transform-block-scoping
  • babel-plugin-proposal-async-generator-functions, babel-preset-env
  • babel-generator, babel-plugin-proposal-optional-chaining
  • babel-plugin-transform-react-jsx, babel-types
  • babel-core, babel-helpers, babel-plugin-transform-computed-properties, babel-runtime-corejs2, babel-runtime-corejs3, babel-runtime
  • babel-helper-member-expression-to-functions, babel-helper-replace-supers, babel-plugin-proposal-class-properties, babel-plugin-transform-classes
  • babel-generator
:nail_care: Polish
  • babel-plugin-transform-block-scoping, babel-traverse
:house: Internal
  • babel-helper-define-map, babel-plugin-transform-property-mutators
  • babel-core, babel-plugin-proposal-class-properties, babel-plugin-transform-block-scoping, babel-plugin-transform-classes, babel-plugin-transform-destructuring, babel-plugin-transform-parameters, babel-plugin-transform-regenerator, babel-plugin-transform-runtime, babel-preset-env, babel-traverse
:running_woman: Performance

Readme

Source

@babel/helper-compilation-targets

Helper functions on Babel compilation targets

See our website @babel/helper-compilation-targets for more information.

Install

Using npm:

npm install --save @babel/helper-compilation-targets

or using yarn:

yarn add @babel/helper-compilation-targets

Keywords

FAQs

Last updated on 22 Dec 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc