-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add bun and netlify-edge builds #143
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 5854ef7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Thanks. I'll review this later! |
@chtibizoux is this ready for reviewing? |
Yes, it's working now ! |
Hi @chtibizoux There is something I want to ask you. First, is the Secode, building Can you check it? |
For Bun build, yes it's necessary to build the app with vite because if you use vite specific code like in HonoX, you can't run it with only Bun directly and static assets in And for Netlify build, I have the same bug when I build it and I don't know why, but I solved it by adding {
"extends": "../../tsconfig.base.json",
"include": [
"src",
"test"
],
"compilerOptions": {
"module": "ES2022",
"target": "ES2022",
"types": [
"vite/client",
"node"
]
},
} Which is weird because it's already there in |
Hi @chtibizoux Regarding this PR, I would like to pass on merging
If you want to run build for // vite.config.ts
import honox from 'honox/vite'
import { defineConfig } from 'vite'
export default defineConfig(({ mode }) => {
if (mode === 'client') {
return {
plugins: [honox()]
}
} else {
return {
build: {
ssr: true,
emptyOutDir: false,
rollupOptions: {
external: [/^node:/],
input: './entry.ts',
output: {
entryFileNames: 'server.js'
}
}
},
plugins: [honox()]
}
}
})
// entry.ts
import { createApp } from 'honox/server'
import { serveStatic } from 'hono/bun'
const app = createApp({
init: (app) => {
app.use(
'/static/*',
serveStatic({
root: './dist'
})
)
}
})
export default app The build command is:
But, we may merge the plugin for Netlify. Thanks. |
I use Bun currently for local development; seems compatible locally without this patch. |
Little plugins to support netlify edge and bun builds.