-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support browserlist as target option #324
Comments
I'm going to close this as a duplicate of #121. I've already done the hard work of adding targets for specific browser versions to esbuild. For example, you can set the environment target to Literally adding support for browserslist queries themselves to esbuild itself doesn't feel appropriate to me. There is already a JavaScript package that interprets the queries and converts them to a list of browser versions, with a lot of custom logic and history around it, and to me it makes more sense for people to just invoke that package instead of replicating that package's code inside esbuild. And having the esbuild package itself depend on the browserslist package would add an unnecessary dependency for most people, which I don't want to do. Also the fact that browserslist queries are dependent on the time the query was executed (e.g. I think the best way to do this is to have esbuild provide the underlying mechanism for this via the |
I handled it this way in my (snowpack) config to collect the browser targets to pass to esbuild:
Basically, queries browserslist to get the targets and change them just a bit to be parsed correctly by esbuild (looks like whitespaces are not welcome here XD), ofc ignoring unsupported targets. |
More accurately code in #121 (comment) |
I've put https://github.com/marcofugaro/browserslist-to-esbuild |
I'm not sure how feasible this is because of the lack of formal spec for browserlist queries so it might not be feasible to port to Go.
The text was updated successfully, but these errors were encountered: