rspack icon indicating copy to clipboard operation
rspack copied to clipboard

[Feature]: Support for `browserslist` baseline queries

Open benjaminblack opened this issue 5 months ago • 1 comments

What problem does this feature solve?

The latest versions of Browserslist directly support Baseline queries, like this:

    "browserslist": [
        "baseline 2022"
    ]

However, because the browserslist config in package.json is global, we cannot use this, even with a pnpm override, because the version of browserslist used by rspack-cli doesn't recognize the config.

After upgrading and switching to a "baseline 2022" config, rspack-cli throws errors:

Error: No browserslist config found to handle the 'browserslist' target.
See https://github.com/browserslist/browserslist#queries for possible ways to provide a config.
The recommended way is to add a 'browserslist' key to your package.json and list supported browsers (resp. node.js versions).
You can also more options via the 'target' option: 'browserslist' / 'browserslist:env' / 'browserslist:query' / 'browserslist:path-to-config' / 'browserslist:path-to-config:env'
    at TARGETS.web (/path/to/node_modules/.pnpm/@[email protected]/node_modules/@rspack/core/dist/index.js:5471:118)
    [...]

What does the proposed API of configuration look like?

Bumping the dependency on browserslist in the rspack-cli package.json.

benjaminblack avatar Nov 12 '25 16:11 benjaminblack

Rspack uses the Rust version browserslist-rs. It does not yet support baseline queries, see: https://github.com/browserslist/browserslist-rs/issues/40

chenjiahan avatar Nov 13 '25 01:11 chenjiahan