I wrote an app in React a few months ago and it seems I didn't keep the source JSX code. I have the Babel-compiled JS code.
Is there a way to decompile this back into JSX code? Thank you.
If you have the .map files (outputted by default with most bundlers - including Create React App) you can use the npm source-map package to convert those files back to the source.
An example of an AWS Lambda function that makes use of this can be found here
Alternatively if your site is deployed somewhere checkout the Source tab of Chrome devtools - it does the same thing as the package and stitches compiled JS code and source-maps back together.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With