Skip to content

Commit

Permalink
Merge pull request #408 from piktur/feat/worker-registration-exclude-…
Browse files Browse the repository at this point in the history
…optimize-deps-#407

#407 Exclude @evolu/common-web from optimizeDeps
  • Loading branch information
steida authored May 21, 2024
2 parents d5d2653 + ec8cc0c commit 81ee4e4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions examples/vite/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
},
Expand Down

0 comments on commit 81ee4e4

Please sign in to comment.