Skip to content

Compiling all .js files with JSX using Cassette #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mcharytoniuk opened this issue Nov 24, 2014 · 2 comments
Closed

Compiling all .js files with JSX using Cassette #52

mcharytoniuk opened this issue Nov 24, 2014 · 2 comments

Comments

@mcharytoniuk
Copy link

Hello! Thank you for React.NET. This is a great library to handle React Elements easily.

I need to find a way to compile all *.js files with JSX transformer (not only "*.jsx"). I found that there is a hard-coded file extension string inside JsxBundleProcessor.cs file:

if (asset.Path.EndsWith(".jsx", StringComparison.InvariantCultureIgnoreCase))

Is there any way to override this extension so Cassette compiles all "*.js" files? React JSX transformer provides some ES6 features that are useful in general so I think it should be configurable.

@Daniel15
Copy link
Member

Thanks for reporting this! Back when that code was written, JSXTransformer did not expose any of the ES6 transforms. Its sole purpose was to transform JSX, so it made sense that it only touched *.jsx files. Now that JSXTransformer is useful even on non-JSX files, it definitely makes sense to remove this restriction.

If you like, you can clone a copy of React.NET, modify that file, and build it locally. The dev-build.bat file in the root of the repository will build the project and package it into NuGet packages in the output folder which you can then install. Feel free to send a pull request if you don't mind fixing it yourself, otherwise I'll fix this soon.

@Daniel15
Copy link
Member

Daniel15 commented Dec 1, 2014

This was included in the 1.3 release: http://reactjs.net/2014/11/1.3.0-release.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants