Skip to content

[fresh@2.0] Ability for plugins to serve static assets #2589

@miguelrk

Description

@miguelrk

From this thread:

for the unocss plugin, I require doing app.get("/uno.css", () => new Response(css, {...}) to serve cached static assets in development, but when I navigate to /uno.css, it will take me to my routes/_error.tsx page with 404. I cannot tell why it won't work for serving static assets, while it does work for normal routes e.g. app.get("/auth", authPageHandler). I also tried using app.all, app.use, as well as path variants like /static/uno.css, /_fresh/static/uno.css to no success. Is this still pending, or how can we serve static assets via app.<METHOD>? If I let the plugin write a file directly at /static/uno.css (instead of serving it via app.<METHOD>, then it does work...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions