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

Allow serving static file outside golte namespaced folder #9

Open
winston0410 opened this issue Jul 26, 2024 · 0 comments
Open

Allow serving static file outside golte namespaced folder #9

winston0410 opened this issue Jul 26, 2024 · 0 comments

Comments

@winston0410
Copy link
Contributor

winston0410 commented Jul 26, 2024

In the embedded go file, it only server files under the assets dir:

golte/golte.go

Line 38 in 428bdde

if strings.HasPrefix(r.URL.Path, "/"+renderer.Assets()+"/") {

But as this module is embedding the whole output of Vite, and as that building processing is controlled by golte cli, it would be very useful and easy to serve all files under client.

Usecase:

  1. I am using vite-plugin-pwa, and generated some assets. However they are not served, as they are not in golte's assets dir.
  2. I tried to pass images to vite's public dir. Those files are copied into the file output, but since golte only serve files under golte's assets dir, they are not served.

Can we remove that condition? @nichady

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

No branches or pull requests

1 participant