Skip to content

Respect Browserslist config in esbuild #11489

@ai

Description

@ai

Description

esbuild doesn’t have built-in Browserslist config.

Benefits:

  • Autoprefixer, postcss-preset-env, Babel and many other tools have. So users may expect Browserslist config.
  • It is great to have only single config to specify target browsers for all tools.
  • With Browserslist config, we can reduce polyfills in esbuild output and make JS works faster.

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions