How to build the just web-app
I am trying to deploy web-app to cloudflare pages. Cloudflare pages uses git commit and checks out code . Then builds and deploy the web-app. I would like to build just the web-app is this possible
8 Replies
Wohooo @p4j4r5, you just became a Waspeteer level 3!
Hi @p4j4r5. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Yes, it is possible to build just the web app in Wasp. Here are the steps you need to follow:
1. Navigate to the
.wasp/build/web-app
directory in your project:
2. Run the following command to build the web client:
Replace <url_to_wasp_backend>
with the URL of the Wasp server that you previously deployed. This command will build the web client and put it in the build/
directory in the web-app
directory.
Please note that the app's frontend is just a bunch of static files, so you can deploy it to any static hosting provider, including Cloudflare Pages.
For more details, you can refer to the Wasp documentation (https://wasp-lang.dev/docs/advanced/deployment/manually#3-deploying-the-web-client-frontend).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Sorry @p4j4r5, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?Directory .wasp/build/web-app won't exist unless I run
wasp build
You want be able to do it that way. Yo can however do
wasp buidl
, take its result for the web-app (client), and push that to a git branch that Cloudflare Pages will then pick up.Thanks @martinsos Yeah I am sort of doing that now. I added a custom command which runs both wasp build and npm run build in .wasp/build/web-app directory. Cloudflare pages doesn't seem to allow option to push the files, so had to do this way
@p4j4r5 I am looking at the same thing: would you mind sharing the CF Pages config you used to get to
.wasp/build/web-app
? I am going to try a few things tonight.https://github.com/wasp-lang/render-ghcr/pull/1/files
Maybe this helps 🙂
It consists of using
wasp build
+ Cloudflare Github Action@miho gotcha - never used GitHub Actions, so will need to investigate.
The approach @p4j4r5 was following was more what I was looking for, since I can use the Cloudflare interface to set it up.