react-starter icon indicating copy to clipboard operation
react-starter copied to clipboard

Static Build

Open chrismcv opened this issue 10 years ago • 5 comments

Hi, I was wondering if it is possible to generate a static build using this starter package? For production, I'd quite like to just plonk a folder into an nginx server, rather than having express running the application. Is that possible?

Thanks, Chris

chrismcv avatar Mar 05 '15 09:03 chrismcv

Propably... You could disable prerendering and use a static html page. react-router need to be switched to hash based mode.

You would loose some benefits like prerendering and pretty urls, but I think it is possible.

sokra avatar Mar 05 '15 19:03 sokra

Possible, but a crying shame.

maletor avatar Apr 03 '15 03:04 maletor

if you are using nginx you can use something like this to keep your pretty urls and push state router

location / {
    try_files $uri /index.html;
}

stream7 avatar Apr 03 '15 12:04 stream7

https://github.com/webpack/react-starter/pull/82 gives this capability, you'd have to make react router hash based in the code though

josephfinlayson avatar Jun 19 '15 08:06 josephfinlayson

@chrismcv - could you test this? https://github.com/webpack/react-starter/pull/82

josephfinlayson avatar Jun 24 '15 21:06 josephfinlayson