babel-preset-react-app doesn't support overriding targets
Created by: heygrady
I'm working on making react-scripts support SSR for my project. I can handle most of what I need by editing react-scripts itself but my server-side build is still using ie: 9 as the target because babel-preset-react-app doesn't allow for overriding the targets.
There was a recent discussion about ignoring the"browserslist" settings, but this is a different ask. I would like to have a way to specify a dev or prod build for my app for either node or browser.
Ideally I would be able to specify the targets as an option to babel-preset-react-app. This allows me to copy webpack.config.dev.js to webpack.config.dev-ser ver.js and make the small handful of changes necessary to target node.
(compare to webpack.config.dev.js)
presets: [
[
require.resolve('babel-preset-react-app/dependencies'),
{
helpers: true,
// wouldn't it be nice to specify target
targets: { node: 'current' }
},
],
],