jaredpalmer / razzle

✨ Create server-rendered universal JavaScript applications with no configuration
https://razzlejs.org
MIT License
11.09k stars 873 forks source link

Use babel-polyfills with browserslist in babel loader #1819

Open fivethreeo opened 2 years ago

fivethreeo commented 2 years ago

Use browserslist if the plugin finds a env for current build

fivethreeo commented 2 years ago

https://github.com/babel/babel-polyfills/blob/main/docs/migration.md

fivethreeo commented 2 years ago

https://github.com/browserslist/browserslist/commit/51a1ad21a071d0af9c441ce9f392782df9573ed3

fivethreeo commented 2 years ago

transform runtime adds all polyfills, ignores target, babel-polyfills respects target

i want to use browserslist to make everything configurable via .browserslistrc envs

for node aswell as web, and per build https://github.com/jaredpalmer/razzle/blob/alpha/packages/razzle-plugin-webpack5/src/index.ts#L17

so .browserslist can have default-web and default-node and e.g. modern-web

current node is a valid target in latest browserslists

fivethreeo commented 2 years ago

also use browserslist in webpack target