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

Vite integration #1406

Merged
merged 41 commits into from
Feb 18, 2023
Merged

Vite integration #1406

merged 41 commits into from
Feb 18, 2023

Conversation

ovidiuch
Copy link
Member

No description provided.

@cloudflare-pages
Copy link

cloudflare-pages bot commented Dec 19, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 44fa1e2
Status: ✅  Deploy successful!
Preview URL: https://2e134934.reactcosmos.pages.dev
Branch Preview URL: https://vite.reactcosmos.pages.dev

View logs

@ovidiuch ovidiuch marked this pull request as ready for review February 18, 2023 20:05
@ovidiuch ovidiuch merged commit db57153 into main Feb 18, 2023
@ovidiuch ovidiuch deleted the vite branch February 18, 2023 20:11
@vlastoun
Copy link

When it will be released?
Do you have example configuration/project how can I include it?
Is it possible to build and serve cosmos with vite?

@ovidiuch
Copy link
Member Author

ovidiuch commented Feb 22, 2023

When it will be released?

@vlastoun Hard to tell the official release date because I'm preparing a major release with a bunch of other changes including a documentation revamp.

But if you're interested in providing early feedback on the Vite integration I can publish an alpha version of React Cosmos 6 sooner than I had planned.

Do you have example configuration/project how can I include it?

There is a Vite example in the repository: https://github.com/react-cosmos/react-cosmos/tree/main/examples/vite. The setup is very simple.

I suspect we'll have to offer a way to pass a Vite config to Cosmos or to pass certain Vite options, but that will be easy to add once we decide it's needed.

Is it possible to build and serve cosmos with vite?

Cosmos has two commands, start and export. With the Vite plugin, the first will start the Vite dev server and the second will build the Vite project and generate a static export. To serve the static export you'll have to use any basic http server and have it serve the static export directory. As simple as http-server -p 5001 ./examples/vite/cosmos-export.

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

Successfully merging this pull request may close these issues.

None yet

2 participants