Fix static generation serve
Static generation was looking for an environment variable that the CLI no longer sets when serving. This PR fixes that issue and makes dx serve just work
Testing this PR on the repo linked in https://github.com/DioxusLabs/docsite/issues/305 ...
dx build --release fails with:
[..]
static-generation build: Build progress 100%
static-generation build: Build progress 100%
static-generation build: --- Optimizing Assets ---
2024-08-27T15:27:46.574076Z INFO dx::builder::cargo: Copying public assets to the output directory...
2024-08-27T15:27:46.574113Z INFO dx::builder::cargo: 🚩 Build completed: [/Users/srid/code/dioxus-static-site/dist]
static-generation build: --- Finished ---
Error: 🚫 Building project failed:
Caused by:
0: Failed to post process build
1: task 13 panicked
dx serve seems to work at first
But it eventually crashes with:
With 0c88b39, dx build --release succeeds, but the static files cannot be opened in the browser when served with a plain http-server (it just serves the file statically from ./dist, like GitHub pages would). I get a page with title, but the body is empty; with these console errors:
dx serve on the other hand, continues to fail (I mean it exists promptly, after printing some warnings):
Even without --release:
@ealmloff Is there something I'm missing here?
dx serve and dx build are kind of confusing for static site generation. Currently build is set up to build the wasm and static site generation binary, but not run it. It should be running it as well. Marking this as a draft until I get more intuitive behavior implemented