W
Wasp-lang•2mo ago
p4j4r5

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
MEE6
MEE6•2mo ago
Wohooo @p4j4r5, you just became a Waspeteer level 3!
kapa.ai
kapa.ai•2mo ago
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:
cd .wasp/build/web-app
cd .wasp/build/web-app
2. Run the following command to build the web client:
npm install && REACT_APP_API_URL=<url_to_wasp_backend> npm run build
npm install && REACT_APP_API_URL=<url_to_wasp_backend> npm run build
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?
p4j4r5
p4j4r5OP•2mo ago
Directory .wasp/build/web-app won't exist unless I run wasp build
martinsos
martinsos•2mo ago
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.
p4j4r5
p4j4r5OP•2mo ago
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
Ricardo Batista
Ricardo Batista•3w ago
@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.
miho
miho•3w ago
https://github.com/wasp-lang/render-ghcr/pull/1/files Maybe this helps 🙂 It consists of using wasp build + Cloudflare Github Action
Ricardo Batista
Ricardo Batista•3w ago
@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.
Want results from more Discord servers?
Add your server