vitejs / vite

Next generation frontend tooling. It's fast!
http://vitejs.dev
MIT License
67.21k stars 6.04k forks source link

Respect Browserslist config in esbuild #11489

Open ai opened 1 year ago

ai commented 1 year ago

Description

esbuild doesn’t have built-in Browserslist config.

Benefits:

Suggested solution

We can use browserslist-to-esbuild as suggested in When Vite ignores your Browserslist configuration article.

In this case, Vite will look for Browserslist config and auto-fill build.target config option.

Alternative

No response

Additional context

Browserslist also supports Node.js versions

Validations

alexanderniebuhr commented 1 year ago

I could understand why for JS features, someone would like to stick with esbuild target syntax. However for css features I don't see any value in it. Vite should allow both syntaxes maybe?

But IMO it would be an easier bet to initially support build.cssTarget, which is used for css feature support (at least in the new v4.4 beta) and adopt build.target later.

yisibl commented 10 months ago

Browserslist is already the most common and versatile syntax in the front-end ecosystem, and I strongly support this proposal.

milton-imageline commented 4 months ago

100%, this makes a lot of sense.

SinaKarimi7 commented 2 months ago

Any update on this?