![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
browserslist-to-esbuild
Advanced tools
Readme
Use browserslist with esbuild.
Allows you to use use browserslist and pass the correct browsers to esbuild's target option.
You have to install the browserslist
package as well in your project:
npm install --save-dev browserslist browserslist-to-esbuild
or
yarn add --dev browserslist browserslist-to-esbuild
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'
await build({
entryPoints: ['input.js'],
outfile: 'output.js',
bundle: true,
target: browserslistToEsbuild(), // --> ["chrome79", "edge92", "firefox91", "safari13.1"]
})
Otherwise, you can pass yourself a browserslist array or string to the function.
browserslistToEsbuild(['>0.2%', 'not dead', 'not op_mini all'])
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.
Type: object | undefined
An object containing the options that will be forwarded to browserslist. You can check out the browserslist options documentation to see all the options available.
You can also use this package on the cli to test out the command in your project. If no argument is passed, the browserslist config is searched in the script running directory.
Here is some example usage:
$ npx browserslist-to-esbuild
chrome109 edge118 firefox115 ios15.6 opera102 safari15.6
$ npx browserslist-to-esbuild '>0.2%, not dead'
chrome103 edge87 firefox115 ios12.2 opera102 safari14.1
$ npx browserslist-to-esbuild '>0.2%' 'not dead'
chrome103 edge87 firefox115 ios12.2 opera102 safari14.1
FAQs
Get esbuild-compatible targets from a browserlist config
The npm package browserslist-to-esbuild receives a total of 235,468 weekly downloads. As such, browserslist-to-esbuild popularity was classified as popular.
We found that browserslist-to-esbuild demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.