Serve static assets from src
folder during development in a custom server setup?
#1914
-
Problem: For instance in Hono custom server + Vike as a middleware, static assets inside
Not sure what I have to do, do I manually enable the if (privateConfig.NODE_ENV === "production") {
app.use(
"/*",
serveStatic({
root: `./dist/client/`,
})
);
} (I will add a minimal reproduction example soon) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
This seems to be a bug, maybe a Vite one. A minimal reproduction would be best indeed. |
Beta Was this translation helpful? Give feedback.
False alarm. Not a bug. It's literally just this in the `vite.config.js.
TL;DR; When running a custom server setup with @hono/vite-dev- make sure to
exclude
png
,jpg
,webp
(static assets) in the devServer plugin.Reproduction here: https://github.com/Blankeos/mre-image-import-vike-bug
1) For Hono's case this is super easy: