on 2024 Jan 15 6:37 PM
Hello experts. I'm trying to deploy a vite reactjs application into my sap btp trial account using cloudfoundry. I already tried this with a reactjs app made with create-react-app and it all went smoothly as soon as I created a manifest.yaml file inside my project.
The thing is that right now I can't deploy a vite reactjs app using the same method. It starts giving me errors at the moment of pushing the app with the command "cf push" into my trial account.
Is there a way to deploy a vite react app into btp trial account using cloudfoundry? I'll leave all the details below.
Manifest.yaml file:
---
applications:
- name: vite-test
path: <path to my dist folder made with npm run build command>
instances: 1
buildpack: staticfile_buildpack
memory: 256M
Error
package.json:
project's folder:
Thank you in advance!
Request clarification before answering.
Hi,
1. Create new vite react-ts project:
pnpm create vite my-react-app --template react-ts
cd my-react-app
pnpm i
2. Create manifest.yaml:
---
applications:
- name: vite-test
path: ./dist
instances: 1
buildpack: staticfile_buildpack
memory: 256M
3. Build and deploy
pnpm build
cf push
Comments:
With staticfile_buildpack you can provide static files and do not rely on build process inside buildpack.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
12 | |
9 | |
8 | |
8 | |
5 | |
4 | |
4 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.