jlengstorf / learn-rollup

This is an example project to accompany a tutorial on using Rollup.
https://code.lengstorf.com/learn-rollup-js/
ISC License
191 stars 61 forks source link

React support #4

Closed ghost closed 7 years ago

ghost commented 7 years ago

I've struggled trying to make react work with rollup. If you find it useful, here is how I solved it.

It would be useful for others if you put a tip at the end of your post. Or you could push it in a branch here for reference.

jlengstorf commented 7 years ago

Thanks for putting this up — I'll add a note to the post. Out of curiosity, did you try Babel's React preset? That could avoid the JSX stuff, which would make the setup even simpler.

ghost commented 7 years ago

I have tried, but it doesn't seem to work out of the box, I'll give it another try and make another commit with the result and let you know what happens.

jlengstorf commented 7 years ago

@wesleycoder how would you feel about sending this in as a pull request? I'll put it on another branch and link to it from the README as a variation on the initial repo. I have #5 open right now to add an Express server, so we'd have two setup variations to start.

ghost commented 7 years ago

Sure, I'll send the PR soon.

ghost commented 7 years ago

May I send the PR to the master branch or will you create another branch in which I'll send the PR? It is ready to send.

jlengstorf commented 7 years ago

@wesleycoder I just created a branch called alt-config/react. Can you send the PR against that one?

Thanks!