Description
Version
System:
OS: macOS 14.6.1
CPU: (11) arm64 Apple M3 Pro
Memory: 874.61 MB / 36.00 GB
Shell: 3.7.1 - /opt/homebrew/bin/fish
Browsers:
Chrome Canary: 133.0.6860.0
Safari: 17.6
Safari Technology Preview: 18.0
npmPackages:
@rsbuild/core: ^1.1.4 => 1.1.6
Details
First of all, I'm sorry if it's a bug in Rspack or SWC - I use RSBuild (and I love it ❤️), I didn't check if the issue occurs in these tools. A quick search across all three issue trackers doesn't reveal already known bug.
The issue is when I use a browser version unknown for RSBuild in my .browserlistrc
, instead of adding no transipilation and polyfills (this is the default @babel/preset-env
behavior), everything is transpilled and polyfilled. That's a bit unfortunate, as the browserslist-rs
tool used under the hood recognizes only browsers released before June 2024. I've already submitted a PR updating the data in that repo. I'm afraid changing how to handle defaults it's beyond my Rust knowledge 😅
Reproduce link
https://github.com/erykpiast/rsbuild-test
Reproduce Steps
-
Install the dependencies:
pnpm install
-
Build the app for production:
pnpm build
-
Observe the JavaScript output artifact contains the generator polyfill.
-
Go to the
.browserslistrc
file and change the Chrome version to 125. -
Build the app for production:
pnpm build
-
Observe the JavaScript does not contain any polyfill.