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

Where should static assets be stored? #218

Closed
onlyfortesting opened this issue Sep 4, 2024 · 1 comment
Closed

Where should static assets be stored? #218

onlyfortesting opened this issue Sep 4, 2024 · 1 comment
Labels

Comments

@onlyfortesting
Copy link

onlyfortesting commented Sep 4, 2024

What version of HonoX are you using?

0.1.24

What steps can reproduce the bug?

In fresh x-basic template, any assets under public directory can't be accessed except /favicon.ico. If I were to use static directory and access it via /static/image.jpg, it works. But that’s confusing because public and static essentially serve the same purpose.

What is the expected behavior?

can access assets under public directory e.g. /image.jpg

What do you see instead?

404 not found

Additional information

using this vite config as workaround:

{
    plugins: [
      honox({
        devServer: {
          adapter,
          exclude: [
            ...devServerDefaultOptions.exclude,
            /^\/app\/.+/,
            /^\/favicon.ico/,
            /^\/static\/.+/,
            /\.(png|jpg|jpeg|svg|webp)$/, // added
          ],
        },
      }),
      pages(),
    ],
}
@onlyfortesting onlyfortesting added the bug Something isn't working label Sep 4, 2024
@onlyfortesting onlyfortesting changed the title Where should static assets stored? Where should static assets be stored? Sep 4, 2024
@yusukebe
Copy link
Member

yusukebe commented Oct 5, 2024

Hi @onlyfortesting

Sorry for the late response. Your workaround is a good solution. It's a little bit annoying, but please use it.

@yusukebe yusukebe added not bug and removed bug Something isn't working labels Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants