Skip to content

Commit

Permalink
Fix loading of matrix-sdk-crypto-wasm when running in local developme…
Browse files Browse the repository at this point in the history
…nt mode (#2915)

Fixes problem loading rust crypto when using `yarn dev`
  • Loading branch information
hughns authored Dec 18, 2024
1 parent ba5da7e commit 6d5dc0d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,12 @@ export default defineConfig(({ mode }) => {
"@radix-ui/react-dismissable-layer",
],
},
// Vite is using esbuild in development mode, which doesn't work with the wasm loader
// in matrix-sdk-crypto-wasm, so we need to exclude it here. This doesn't affect the
// production build (which uses rollup) which still works as expected.
// https://vite.dev/guide/why.html#why-not-bundle-with-esbuild
optimizeDeps: {
exclude: ["@matrix-org/matrix-sdk-crypto-wasm"],
},
};
});

0 comments on commit 6d5dc0d

Please sign in to comment.