Skip to content
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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Adds React Export Option #335

wants to merge 12 commits into from

Conversation

marklundin
Copy link
Member

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 stored dist/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

image

@marklundin marklundin added the enhancement New feature label Dec 12, 2024
@marklundin marklundin self-assigned this Dec 12, 2024
@willeastcott
Copy link
Contributor

Can we maybe cull some unecessary files such as .gitignore, eslint.config.mjs, etc?

@willeastcott
Copy link
Contributor

You still need to cull .env, .gitignore, eslint.config.mjs plus whatever else might not be needed.

@marklundin
Copy link
Member Author

marklundin commented Dec 19, 2024

You still need to cull .env, .gitignore, eslint.config.mjs plus whatever else might not be needed.

removed .gitignore, eslint.config.mjs. .env is used to store the config settings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants