Reputation: 16629
How can we minify .jsx
files which are used in React js. Normal minification process does not work.
Is there a separate tool for .jsx
files?
Upvotes: 9
Views: 11797
Reputation: 3571
In-browser JSX Transformation is generally not recommended for usage in production.
So you have the option to precompile the JSX into plain JavaScript and then continue with the minifying like you would normally do.
For more information: https://facebook.github.io/react/docs/tooling-integration.html
Personally I am using Reactify for the JSX to JavaScript transformation and then I run UglifyJS to minify the result. It is very easy to automate in your build process.
Upvotes: 11