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

esbuild-plugin-browserslist

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esbuild-plugin-browserslist

Configure esbuild's target based on a browserslist query

  • 0.4.9
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
75K
decreased by-7.1%
Maintainers
1
Weekly downloads
 
Created
Source

esbuild-plugin-browserslist

build status

Configure esbuild's target based on a browserslist query

Installation

yarn add esbuild-plugin-browserslist esbuild browserslist

Usage

const esbuild = require('esbuild');
const browserslist = require('browserslist');
const {
  esbuildPluginBrowserslist,
  resolveToEsbuildTarget,
} = require('esbuild-plugin-browserslist');

await esbuild.build({
  entryPoints: ['./foo/bar.ts'],
  // ... other options (except `target`) ...
  plugins: [
    esbuildPluginBrowserslist(browserslist('defaults'), {
      printUnknownTargets: false,
    }),
  ],
});

// Or:

const target = resolveToEsbuildTarget(browserslist('defaults'), {
  printUnknownTargets: false,
});

await esbuild.build({
  entryPoints: ['./foo/bar.ts'],
  target,
});

Caveats

  • Only edge, firefox, chrome, safari, ios_saf, and node have direct equivalents for esbuild targets.
  • android and and_chr are mapped to the chrome target, and and_ff is mapped to the firefox target.
  • All other browsers are ignored (and_qq, samsung, opera, op_mini, op_mob, ie, ie_mob, bb, baidu, and kaios)

Debugging

You can turn on debug logs (which will print all resolutions or failures) using DEBUG=esbuild-plugin-browserslist

FAQs

Package last updated on 07 Apr 2022

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