-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
Use npm prepublish script to transform jsx #179
Use npm prepublish script to transform jsx #179
Comments
I had also this issue. You should use the harmony option in reactify/jsx-loader when compiling your javascript. With webpack, for example, use |
@gpbl: I'm using gulp and I just now tried: But it still throws the same error. Also tried putting this in (like the example) Tried: |
So how do other people use this npm module, without any extra files & knowledge? Also tried for browsify:
|
@TrySpace this seems related: https://github.com/sindresorhus/gulp-react/issues/21. I have no experience with gulp-react. Would passing
You can see in browserify dependency in package.json for the docs project, that it includes reactify with es6 enabled. But I do agree it is confusing. @hai-cea wouldn't a compiled version work better? Not everyone uses harmony :-) |
@gpbl Well, that partially helped, now it throws at |
Ok, so I fixed it by adding:
to package.json So, case closed |
I think this should be added to documentation because I also spend some time to fix it |
I had the same problem. Updating node-jsx to "0.12.4" and by passing in harmony to true fixed this issue
Great work on this library! Stellar! |
@TrySpace hey, it does not work for me. i am generating code from gulp based on this configuration https://github.com/tcoopman/react-es6-browserify var reactifyES6 = function(file) {
return reactify(file, {'es6': true});
};
...
bundler.transform(reactifyES6); Does not work either |
Take a look on my gulpfile https://github.com/DragonLegend/game/blob/master/public/gulpfile.js#L127 or do it like in example https://github.com/callemall/material-ui/blob/master/example/package.json#L5 |
i'm using grunt like this sample , but it's not working for me
|
IMO transforming should be done on the library's side, not consumer's. |
Yep - I agree with @gaearon |
When I try:
It throws this error on parsing:
Error: Parsing file C:\xxxx\node_modules\material-ui\src\js\dialog.jsx: Line 28: Unexpec
ted token ...
This seems to be because there's some ECMAscript 6 stuff in there, but the documentation doesn't say/warn anything about this...
I had assumed npm would have no trouble with ES6, but it does.
Any solutions for this?
The text was updated successfully, but these errors were encountered: