-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds React Export Option #335
base: main
Are you sure you want to change the base?
Conversation
Can we maybe cull some unecessary files such as |
… in splat-serialize.ts to use global JSZip reference.
You still need to cull |
removed |
Where do we want this export option @willeastcott @slimbuck. As an option in the dropdown? Let me know, so I can update and we can get this merged. ![]() |
React Export
This PR adds an option for exporting a React app using the
@playcanvas/react
library.The export generates a project zip file that contains all the necessary assets and dependencies. Once downloaded you can run
npm install && npm run dev
to run the project. The zip is a Vite project so it works with live reload etc.Implementation
The project template is stored in
/src/templates/react
. At build time, this is compiled to a template zip storeddist/static/templates/react.zip
. When a user exports their splat at runtime, this template zip is loaded, the.ply
is injected into to the zip, the necessary variables are added to the.env
file and the subsequent zip is downloaded.Currently, the zip export is in the
Scene -> Export -> React App
menu