create-react-app by default uses browserslist, but as I see it works only for *.js files (I'm not so sure), for *.ts no difference.
My env (generated by create-react-app):
- webpack: ~4.29.6
- react: ~16.12.0
- typescript: ~3.7.2
Code of project consists of *.ts / *.tsx files only.
I've tried to add Object.entries polyfill by:
- Changing
browserslistinpackage.jsonby addingIE 9,chrome >20, etc... - But to no avail (dist was not changed) - Changing
compilerOptions.targetintsconfig.jsontoes5- But to no avail (dist was not changed) - Adding to
compilerOptions.libintsconfig.jsonnew values:es5,es6,es7, etc... - But to no avail (dist was not changed)
Only adding import 'react-app-polyfill/stable'; gives me Object.entries polyfill, but with ~600kb of other polyfills :(
Questions:
- Is browserslist in create-react-app project uses ONLY for
*.jsfiles? - Is there currently no way to use browserslist for auto-adding polyfills for compiling TypeScript project?
- Is browserslist completely useless for TypeScript project?