Skip to content

[Feature]: Support for browserslist baseline queries #12172

@benjaminblack

Description

@benjaminblack

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions