vite.config.ts 626 B

12345678910111213141516171819202122
  1. import reactStack from 'hono-vite-react-stack'
  2. import { defineConfig } from 'vite'
  3. import { defaultOptions as buildDefaultOptions } from '@hono/vite-build/cloudflare-workers'
  4. export default defineConfig({
  5. build: {
  6. rollupOptions: {
  7. external: ['cloudflare:workers']
  8. }
  9. },
  10. plugins: [
  11. reactStack({
  12. buildPluginOptions: {
  13. entryContentAfterHooks: [
  14. ...buildDefaultOptions.entryContentAfterHooks,
  15. () => `export { MyDurableObject } from "/src/server/do"`
  16. ],
  17. entryContentDefaultExportHook: buildDefaultOptions.entryContentDefaultExportHook
  18. }
  19. })
  20. ]
  21. })