React-starter-kit: Export client-only version

Created on 19 Sep 2015  路  13Comments  路  Source: kriasoft/react-starter-kit

This is the most complete react template and I love it but it can only be deployed to a node server. How to build a client-only version which would run with any basic http server or even on github in gh-pages branch?

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

question

All 13 comments

You may want to use a similar template but optimized for hosting in CDN: React Static Boilerplate

@koistya :

Is it unpractical for proposing add build flags like npm build -- static to current stack, by adding static-site-generator-webpack-plugin to current automation scripts in /tools/, so that we can have both options of hosting react by node server and static?

If it shouldn't be done, can you explain why?

I would also love this!

@koistya I'm also curious why this warrants another repo since this seems to get 95% of the job done.

:+1: It would be great to be able to use RSK as SPA with other backends like Rails, Java, not just node.

Initial description of this project is probably a bit misleading - you'd rather name it react-node-starter-kit.

Refs: #368

Thanks

There are several cases where you would want both isomorphic and client side builds available.

Is this trivial to add?

@okendoken I know many folks who are using Ruby, .NET, PHP, Go etc. on the backend, still have Node.js in their setup just for server-side rendering of the React app. This project fits well in this scenario since there is very little server-side code.

@Jeger It shouldn't be that hard I think, I was going to add --static option for the build scripts, which would allow to build only the client-side portion of the app, ready to be deployed to a static site host provider (GitHub Pages, Amazon S3 etc.).

I'd love that feature, as we are trying not to use node as a backend server, but java.
:+1:

That'd be awesome, @koistya!

@koistya that solution would be perfect as far as I'm concerned. And as an added bonus it would widen the group of target users a lot for this project.

While doing some research for starter kits and boilerplates, this is by far the most starred, forked and active repo. The static alternatives are a lot less mature and active.

:-1: 小ompletely agree with @koistya - there is no place for "client only".

The --static flag generates the .html files correctly, but when I try to launch the built application (with web root set to build/public), it can't find /graphql (it returns 404). Is there anything else that has to be done apart from npm run build -- --static? When I run the application with node build/server.js, it works correctly.

It would be nice if the app could be exported to a single directory that could be launched as a web root with any web server.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sap9433 picture sap9433  路  4Comments

shikelong picture shikelong  路  4Comments

rochadt picture rochadt  路  3Comments

Bogdaan picture Bogdaan  路  3Comments

shawn-dsz picture shawn-dsz  路  4Comments