I have a react typescript project and I need to convert the source code (NOT THE BUILD) to ES3 or ES5 JavaScript. This is because I want to use this code as a component in another React app.
Can you suggest which preset and plugins I should use for this task?
I have experimented with the following babel presets and plugins:
"presets": [
"@babel/preset-env",
"@babel/preset-react",
"@babel/preset-typescript",
"@babel/preset-flow"
],
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-optional-chaining",
"@babel/plugin-transform-typescript"
],
In the past, my project was plain ReactJs without Typescript and back then, I was able to transpile using the following combination:
"presets": [
"@babel/preset-react"
],
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-optional-chaining",
],
Requesting help on how to convert ReactJs + Typescript source code to es3/es5 JavaScript.