diff --git a/examples/vite/vite.config.ts b/examples/vite/vite.config.ts index fa6078aa7..c9ff94edd 100644 --- a/examples/vite/vite.config.ts +++ b/examples/vite/vite.config.ts @@ -4,8 +4,12 @@ import { defineConfig } from "vite"; // https://vitejs.dev/config/ export default defineConfig({ optimizeDeps: { - // A workaround for Vite bug: https://github.com/vitejs/vite/issues/13314#issuecomment-1560745780 - exclude: ["@evolu/react"], + exclude: [ + // Do not pre-bundle `@evolu/common-web`. Why? Worker relative import path resolution fails on registration because `@evolu/common-web/dist/*.worker.js` + // is not present in Vite's pre-bundled dependencies cache (typically `node_modules/.vite/deps`). + // @see https://github.com/vitejs/vite/issues/13314#issuecomment-1560745780 + "@evolu/common-web", + ], // Another workaround for Vite bug: https://github.com/radix-ui/primitives/discussions/1915#discussioncomment-5733178 include: ["react-dom"], },