prep icon indicating copy to clipboard operation
prep copied to clipboard

Example missing serving of static files

Open sedubois opened this issue 9 years ago • 2 comments

I just discovered this project which looks quite promising to enable SSR with almost no configuration overhead in my React projects. So I went to look at the example, which runs fine and generates static files as promised, but then these files are apparently not used when running npm start. It would be nice to have a minimal example showcasing how these generated files are actually combined with the rest of the development and deployment experience.

sedubois avatar Oct 24 '16 08:10 sedubois

If appropriate, I'd like to understand how to integrate this into react-boilerplate.

sedubois avatar Oct 24 '16 08:10 sedubois

@sedubois FWIW I've added prep to create-react-app using the following code in the scripts portion of the package.json.

"build": "react-scripts build && npm run prerender",
"prerender": "babel src/prerender/index.js -o src/prerender/prep.js && prep -c src/prerender/prep.js build",

Babel step is optional but required if using async / await

mvanlonden avatar May 19 '17 19:05 mvanlonden