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

Open
onlyfortesting opened this issue Sep 4, 2024 · 0 comments
Open

Where should static assets be stored? #218

onlyfortesting opened this issue Sep 4, 2024 · 0 comments
Labels
bug Something isn't working

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant