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

Static assets from '/public/' dir does not handled #2

Closed
genesem opened this issue Sep 11, 2023 · 2 comments
Closed

Static assets from '/public/' dir does not handled #2

genesem opened this issue Sep 11, 2023 · 2 comments

Comments

@genesem
Copy link

genesem commented Sep 11, 2023

Static assets from '/public/' dir does not handled well.
i.e. having file in '/public/robots.txt' does not work as expected,
it produces 404 error as it 's intercepted by this dev. server plugin but not vite.

temp workaround atm. was using option:

exclude: ['.*.ts', '.*.tsx', '/@.+', '/node_modules/.*', '/inc/.*', '.*.txt', '.*.ico' ], - added exlude paths.

@yusukebe
Copy link
Member

Hi @genesem !

As you do, we should use the exclude field to handle a /public or others:

import { defaultOptions } from '@hono/vite-dev-server'
import devServer from '@hono/vite-dev-server'

export default defineConfig({
  plugins: [devServer({
    exclude: [...defaultOptions.exclude, "*.ico", "/app/.+"],
  })]
})

With #3, the files to ignore are hard coded. We must not do that. Anyway, thanks!

@yusukebe
Copy link
Member

Fixed by #13

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

2 participants