-
-
Notifications
You must be signed in to change notification settings - Fork 780
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
Pre-compile to JS from JSX #14
Comments
I was actually going to open an issue with the opposite concern. npm install gives me a js file, and I'm using gulp and Webpack. After adding the require in a JSX file and putting in the code for Dropzone component ,Webpack gave this error:
Whether you get an error like this appears how you have React or React/Flux project set up. I fell into JSX to JS transpiling with gulp/webpack but there are other methods. Might be good to include instructions and/or accommodations as a result. I ended up just copying the contents of index.js from the dropzone module into a new JSX file in my components folder and that seems to have worked. |
Hi @alex-dixon that is the same problem I encountered. Perhaps misleading description given the file in node_modules has a .js but the code inside is in fact jsx format. Also using gulp (transform jsx, browserify) workflow and my work around was similar, to copy the jsx (.js) file to my local components folder and transpile it to jsx as if it were my own component so my browserify "require" paths work properly. What would work perfectly for my gulp worfklow is: 1.) Change the existing index.js file to a index.jsx. This would allow use directly from node_modules without having to jsx transpile in my build. This removed hassles in copy/pasting that is necessary to respect the "require" paths needed for browserify. Thanks for helping clarify! |
Switched out the JSX for javascript. See this issue: react-dropzone#14
Closing as merged PR by @BDiehr. |
Switched out the JSX for javascript. See this issue: react-dropzone/react-dropzone#14
Hello,
When installing with npm the index.js is still in jsx format. I'd love to use it directly without having to compile it as a 3p lib within my application. Could you compile to JS as part of the build?
A bit new to react so if there is a better way I'd love to know!
Thanks.
The text was updated successfully, but these errors were encountered: