Socket
Socket
Sign inDemoInstall

@babel/helper-define-polyfill-provider

Package Overview
Dependencies
70
Maintainers
4
Versions
30
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @babel/helper-define-polyfill-provider

Babel helper to create your own polyfill provider


Version published
Weekly downloads
29M
increased by0.99%
Maintainers
4
Install size
3.06 MB
Created
Weekly downloads
 

Package description

What is @babel/helper-define-polyfill-provider?

The @babel/helper-define-polyfill-provider package is part of the Babel ecosystem and is used to define a way to provide polyfills in your Babel configuration. It helps in specifying which polyfills to include based on the target environment and the features used in your code, ensuring that only necessary polyfills are added, thus optimizing the bundle size.

What are @babel/helper-define-polyfill-provider's main functionalities?

Define polyfill provider

This code sample demonstrates how to define a custom polyfill provider using the @babel/helper-define-polyfill-provider package. It specifies polyfills for 'Promise' and 'fetch' with their respective detection logic and paths to their polyfill modules.

import { createPolyfillProvider } from '@babel/helper-define-polyfill-provider';

const myPolyfillProvider = createPolyfillProvider({
  name: 'myPolyfillProvider',
  polyfills: {
    'Promise': {
      global: 'Promise',
      detection: 'Promise in global',
      path: 'core-js/modules/es.promise'
    },
    'fetch': {
      global: 'fetch',
      detection: 'fetch in global',
      path: 'whatwg-fetch'
    }
  }
});

Other packages similar to @babel/helper-define-polyfill-provider

Readme

Source

@babel/helper-define-polyfill-provider

Install

Using npm:

npm install --save-dev @babel/helper-define-polyfill-provider

or using yarn:

yarn add @babel/helper-define-polyfill-provider --dev

Keywords

FAQs

Last updated on 21 Jul 2023

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