Socket
Socket
Sign inDemoInstall

browserslist-to-esbuild

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browserslist-to-esbuild

Use browserslist with esbuild


Version published
Weekly downloads
324K
increased by4.65%
Maintainers
1
Weekly downloads
 
Created
Source

browserslist-to-esbuild

Use browserslist with esbuild.

Allows you to use use browserslist and pass the correct browsers to esbuild's target option.

Install

npm install --save-dev browserslist-to-esbuild

or

yarn add --dev browserslist-to-esbuild

Usage

You can call browserslistToEsbuild() directly in your esbuild.mjs script, it will look for your browserslist config in either package.json or the .browserslistrc.

It will return an esbuild-compatible array of browsers.

import { build } from 'esbuild'
import browserslistToEsbuild from 'browserslist-to-esbuild'

build({
  entryPoints: ['input.js'],
  outfile: 'output.js',
  bundle: true,
  target: browserslistToEsbuild(), // --> ["chrome79", "edge92", "firefox91", "safari13.1"]
}).catch(() => process.exit(1))

Otherwise, you can pass yourself a browserslist array or string to the function.

browserslistToEsbuild(['>0.2%', 'not dead', 'not op_mini all'])

API

browserslistToEsbuild(browserslistConfig?)

browserslistConfig

Type: array | string | undefined

An array of string of browsers compatible with browserslist. If none is passed, a browserslist config is searched in the script running directory.

Keywords

FAQs

Package last updated on 16 Dec 2021

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc