# Ionic React Static web site?

**URL:** <https://forum.ionicframework.com/t/ionic-react-static-web-site/185587>\
**Category:** Ionic React\
**Created:** [March 21, 2020, 11:46pm UTC](https://forum.ionicframework.com/t/ionic-react-static-web-site/185587 "2020-03-21T23:46:19Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![joself](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/joself/32/129912_2.png) [@joself](https://forum.ionicframework.com/u/joself)\
**Post date:** [March 21, 2020, 11:46pm UTC](https://forum.ionicframework.com/t/ionic-react-static-web-site/185587/1 "2020-03-21T23:46:20Z")

</div>

Is it possible to export a project made with Ionic React to a static website?  
I’m using my project in firebase, but I need to run it on my Apache server, and I didn’t understand this part in the documentation.

---

<div class="post-metadata">

**Author:** ![joself](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/joself/32/129912_2.png) [@joself](https://forum.ionicframework.com/u/joself)\
**Post date:** [March 23, 2020, 2:00am UTC](https://forum.ionicframework.com/t/ionic-react-static-web-site/185587/2 "2020-03-23T02:00:39Z")

</div>

I’m a beginner on the subject … is it a stupid question?

---

<div class="post-metadata">

**Author:** ![maxlynch](https://avatars.discourse-cdn.com/v4/letter/m/df788c/32.png) [@maxlynch](https://forum.ionicframework.com/u/maxlynch)\
**Post date:** [March 23, 2020, 4:12am UTC](https://forum.ionicframework.com/t/ionic-react-static-web-site/185587/3 "2020-03-23T04:12:44Z")

</div>

Yes, it’s possible. You’ll want to use it with Gatsby or Next.js. Note: Ionic React doesn’t fully support Server Side Rendering just yet but we are working on making it work well with Next.js’s SSR first

---

<div class="post-metadata">

**Author:** ![mirkonasato](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mirkonasato/32/131398_2.png) [@mirkonasato](https://forum.ionicframework.com/u/mirkonasato)\
**Post date:** [March 25, 2020, 6:00pm UTC](https://forum.ionicframework.com/t/ionic-react-static-web-site/185587/4 "2020-03-25T18:00:37Z")

</div>

If you run `ionic build` it will generate a `build` folder with all the static files. You just need to upload that folder to your web server.

---

<div class="post-metadata">

**Author:** ![vicmortelmans](https://avatars.discourse-cdn.com/v4/letter/v/ce73a5/32.png) [@vicmortelmans](https://forum.ionicframework.com/u/vicmortelmans)\
**Post date:** [April 11, 2020, 10:53pm UTC](https://forum.ionicframework.com/t/ionic-react-static-web-site/185587/5 "2020-04-11T22:53:53Z")

</div>

Hi,

I’m having the same question. I’m new to Ionic (disclaimer).

My static website has a single page with some nifty animations (link [here](https://gebeden.gelovenleren.net/#), if you care to take a look), which I deployed in the past as a website (native html5/javascript/css development) and as an Android app, built using phonegap. I got some feedback that performance of the app was bad, so I’m taking my bets that a refactoring using ionic would be an improvement AND provide me with a more consistent process to deploy to all targets.

I’ve installed ionic v6.5 + react + capacitor. I chose react over angular for no particular reason and capacitor over cordova because it was presented as an upgrade of the latter.

For experimenting, I’ve started a project using the blank template. Serve and build work fine. In Android Studio, I’ve been able to build a signed APK. So far so good.

But I’m completely puzzled on how I should deploy my code as a static website. I expect to find a set of files to upload to my server (i.c. rsync to google cloud storage).

I see the files in the `build` folder, but I can’t get them to work. Once deployed, the `index.html` is served, but I see a blank page and no errors at all in the chrome debugger console. Here’s a link to the deployed `build` folder: [http://test.gelovenleren.net/index.html](http://test.gelovenleren.net/index.html) (mind, this is a test bucket, it may be updated at any time)

I have the same when I serve the `build` folder on localhost using `python -m SimpleHTTPServer`. This is strange: when I do a `ionic serve`, the page is displayed OK on the localhost with the port chosen by ionic, AND as long as `ionic serve` is running, I also get the page displayed OK on the localhost port where SimpleHTTPServer is running. When I close `ionic serve`, the SimpleHTTPServer goes blank again… Quite puzzling how they interact?

In the docs for `ionic build`, I find the option `--engine=browser`, but no explaination on what it does. Is it relevant?

With all the claims for ionic to be used as platform for both mobile apps and websites, I’d have expected a clear tutorial on how to actually deploy the website, but so far I’ve only found articles referring to older ionic releases, which seem to be quite different from the later versions?

I hope that someone can take the time to guide me through this, so I can attempt some real coding…

Thanks!!

Best regards,  
Vic

---

<div class="post-metadata">

**Author:** ![aaronksaunders](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/aaronksaunders/32/13729_2.png) [@aaronksaunders](https://forum.ionicframework.com/u/aaronksaunders)\
**Post date:** [April 12, 2020, 1:46am UTC](https://forum.ionicframework.com/t/ionic-react-static-web-site/185587/6 "2020-04-12T01:46:29Z")

</div>

![Screen Shot 2020-04-11 at 9.46.02 PM](https://global.discourse-cdn.com/ionicframework/original/3X/7/4/7471f6b25cd90f16d610ebfb10d47064e6410eb7.png)

---

<div class="post-metadata">

**Author:** ![mirkonasato](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mirkonasato/32/131398_2.png) [@mirkonasato](https://forum.ionicframework.com/u/mirkonasato)\
**Post date:** [April 12, 2020, 10:07am UTC](https://forum.ionicframework.com/t/ionic-react-static-web-site/185587/7 "2020-04-12T10:07:48Z")

</div>

> [@vicmortelmans](#):
>
> I see the files in the `build` folder, but I can’t get them to work. Once deployed, the `index.html` is served, but I see a blank page and no errors at all in the chrome debugger console.

That’s the right approach, the `build` folder contains all the static files that you need for deployment.

Why it doesn’t work in your case it’s difficult to tell without seeing the code. Looking at your link, I suspect it’s showing a blank page simply because there is no `Route` in your code matching `/index.html` as the `path`.

Client-side page navigation relies on the browser [History API](https://developer.mozilla.org/en-US/docs/Web/API/History_API). For it to work the [server needs to be configured](https://router.vuejs.org/guide/essentials/history-mode.html#example-server-configurations) to serve `index.html` for all paths.

I don’t think `python -m SimpleHTTPServer` does that. Locally you can try with [serve](https://www.npmjs.com/package/serve):

`npx serve -s build/`

---

<div class="post-metadata">

**Author:** ![vicmortelmans](https://avatars.discourse-cdn.com/v4/letter/v/ce73a5/32.png) [@vicmortelmans](https://forum.ionicframework.com/u/vicmortelmans)\
**Post date:** [April 19, 2020, 2:51pm UTC](https://forum.ionicframework.com/t/ionic-react-static-web-site/185587/8 "2020-04-19T14:51:37Z")

</div>

Hi,

thanks! That solved it. On Google Cloud Storage, I had to update the “Website configuration” of the bucky, to have it load `index.html` by default.

Best regards,  
Vic

---

<div class="post-metadata">

**Author:** ![mylord](https://avatars.discourse-cdn.com/v4/letter/m/3ab097/32.png) [@mylord](https://forum.ionicframework.com/u/mylord)\
**Post date:** [July 29, 2021, 6:28am UTC](https://forum.ionicframework.com/t/ionic-react-static-web-site/185587/9 "2021-07-29T06:28:47Z")

</div>

Where to set the entire webapp to load all contents from eg [myapp.com/index.html](http://myapp.com/index.html)?

Also, is this/still an issue wrt to stencil and no node runtime support? [https://www.reddit.com/r/ionic/comments/n4ts3l/ionic\_react\_server\_side\_rendering/](https://www.reddit.com/r/ionic/comments/n4ts3l/ionic_react_server_side_rendering/)
