rjz / es6-client-boilerplate

Starting point for client-side es6 projects
Other
4 stars 1 forks source link

hard to use on server side #4

Closed ghost closed 9 years ago

ghost commented 9 years ago

Seems like this one too would be hard to use on server side? How are this going to work in nodejs and iojs? Compile down to AMD ES5, and export the name would do it. As I could see of the minified source code, the first line: ! function(e) { function r(t) { would give issues.

And you should deal with window / document. PhantomJS are great, but you need to sort out if window / document are existing in a nodeJS / ioJS environment.

As you may see for REACT and others using similiar solution they compile down to ES5 AMD.

rjz commented 9 years ago

This project really isn't aimed at a server-side environment—just at giving client-side developers a jumping-off point for ES6-enabled projects. README is updated to clarify, but please feel free to follow up or submit a PR with any additional clarifications!

ghost commented 9 years ago

@rjz I figured it out, and setting things up to work server side is another story. I just put up my own workflow now for server-side. Anyway. If you in the future if you choose to support both sides, it would be an easy move. Drop phantomJS, and install jsdom-nogyp to be sure it works on windows too. etc.

And then it will work the same way as if you are running a phantomJS launcher etc. Cheerio is great too, but will give trouble in the long run.