Ad

Can I Use Reactstarterkit.com For Building Client Side React App Not Served From Node.js?

- 1 answer

As I can tell react starter kit (reactstarterkit.com) is intended to be served from node.js and developed further into full stack JavaScript app. Can I use it only for developing pure client side react app?

Ad

Answer

Yes, but you would need to modify the build process to make it generate static .html pages similar to how it's implemented in react-static-boilerplate by the same author.

You may want to keep all existing build scripts in case you need to switch back to a full-stack Node.js/React app, but just add a support of building only static portion of the site by appending --static flag to the build command (npm run build -- --static or npm start -- --static). With this flag there will be an additional build step which traverses all the routes and generates static .html pages, or if you don't care about SEO it can generate a single index.html page in the root of the build output folder and make your static site serve this page for all HTTP requests.

Ad
source: stackoverflow.com
Ad