Skip to content
This repository has been archived by the owner on Dec 24, 2019. It is now read-only.

JSX is not precompiled #8

Closed
dotted opened this issue Mar 22, 2015 · 5 comments
Closed

JSX is not precompiled #8

dotted opened this issue Mar 22, 2015 · 5 comments

Comments

@dotted
Copy link

dotted commented Mar 22, 2015

JSX isn't precompiled so when compiling it I get:

ERROR in ./~/react-notification/web_modules/notification.js
Module parse failed: /home/[..]/node_modules/react-notification/web_modules/notification.js Line 128: 
Unexpected token <
You may need an appropriate loader to handle this file type.
|   render: function () {
|     return (
|       <div className="notificiation-bar" style={this.getBarStyles()}>
|         <div className="notification-bar-wrapper" onClick={this.handleClick}>
|           <span className="notification-bar-message">{this.props.message}</span>
@pburtchaell
Copy link
Owner

Why not use use a compiler? Are you using this server-side?

@dotted
Copy link
Author

dotted commented Mar 22, 2015

I'm not using it server side, I'm using webpack, but I have excluded my node_modules folder in order to decrease transpile time.

There are 2 options as I see it to solve this on my end, neither of which is ideal.

  • Havel babel-loader traverse my node_modules folder, increasing my compilation time from my current 4 seconds to over 30 seconds.
  • Special case react-notification in my webpack config so it gets transpiled on my end. This could work, but the way I see it is that I end up having to special case every single module I could consider using - a maintenance nightmare.

All I'm asking you to do is transpile the code before publishing, so us consumers can use the code as is. I would suggest reading this to see how they did it.

@pburtchaell
Copy link
Owner

Added in the compiled code on the v1.1.0 branch.

You can install it with npm install git://github.com/pburtchaell/react-notification.git#v1.1.0

Let me know if that works for you and I will merge and publish to npm.

@dotted
Copy link
Author

dotted commented Mar 22, 2015

Works on my end, thanks!

@pburtchaell
Copy link
Owner

Great. v1.1.0 is released to npm. Closing.

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

No branches or pull requests

2 participants