I have a react typescript project. And I need to convert the source code (NOT THE BUILD) to ES3 or ES5 Js. Because I want to use this code as a component in another react app.
Can you please suggest which preset and plugins to use to do the job?
I have tried the combination of 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"
],
Earlier I my project was plain reactJs without typescript and at that time I was able to transpile using following combination.
"presets": [
"@babel/preset-react"
],
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-optional-chaining",
],
Kindly provide a solution to convert ReactJs + Typescript source code to es3/es5 js.