-
Notifications
You must be signed in to change notification settings - Fork 40
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
@hono/vite-build/bun staticPaths not working #215
Comments
What about running the following command to build:
|
i am running this command |
on debugging bellow code import buildPlugin from "../../base.js";
import { serveStaticHook } from "../../entry/serve-static.js";
const bunBuildPlugin = (pluginOptions) => {
// I can see pluginOptions.staticPaths = ["/static/*"]
return {
...buildPlugin({
...{
entryContentBeforeHooks: [
async (appName, options) => {
options.staticPaths = [...options.staticPaths, "/static/*"]
// Here, options.staticPaths is []
// If I hardcode the value of options.staticPaths to "/static/*", it works fine
let code = "import { serveStatic } from 'hono/bun'\n";
code += serveStaticHook(appName, {
filePaths: options?.staticPaths,
root: pluginOptions?.staticRoot
});
return code;
}
]
},
...pluginOptions
}),
name: "@hono/vite-build/bun"
};
};
var bun_default = bunBuildPlugin;
export {
bun_default as default
}; |
Can you share a minimal project to reproduce it? If so, I can help you. |
@yusukebe
My css is under /const/forum.css Stacks: Bun + Hono + Vite middleware (Latest versions) |
This configuration works when I run the development server. However, when I run the build command and execute bun index.js in the dist directory, it does not serve the static directory inside the dist folder. I tried adding staticPaths: ["/static/*"], but it still did not work.
project structure
src :
- client.tsx
- index.css
- server.ts
server.ts code
client.tsx code
The text was updated successfully, but these errors were encountered: