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

Change cosmos fixtures structure and vite plugin logic #100

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

oldbear26
Copy link

@oldbear26 oldbear26 commented Jan 5, 2025

There are a couple of reasons that are causing #96, which only happens in production while working normally in development:

  1. The reliance on a Vite plugin to to read the content of the code. This won't work in production because it's a static site, there is no Vite server, and also because the code files get bundled so there is nothing to read.
  2. The reliance on import.meta.url to get the name of the file. This also doesn't work for the same reason.

The solution I am proposing here is to move all the fixtures examples to the public directory so that they can be served by the server, and replacing the Vite server plugin with a transformer that replaces the import.meta.url with the fixture name. Not really sure whether this is the best solution, partially because I am a little confused about the usage of this code previewer. Feel free to point out if there is a better solution.

/claim #96

- Move the fixtures to the public directory to be available after build
- Remove the custom vite server plugin
Copy link

algora-pbc bot commented Jan 5, 2025

💵 To receive payouts, sign up on Algora, link your Github account and connect with Stripe.

@oldbear26
Copy link
Author

Hello @seveibar. Can you take a look at this?

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

Successfully merging this pull request may close these issues.

1 participant