From 236ed5b1ea4f3d30ece990ecb371e81002a9f7ff Mon Sep 17 00:00:00 2001 From: aq Date: Wed, 3 Dec 2025 22:10:05 +0400 Subject: [PATCH] fix: configure Vite to handle WASM files from dependencies - Add assetsInclude config to treat WASM as assets - Prevent WASM files from being inlined as base64 with assetsInlineLimit This ensures WASM files from dependencies are properly served as separate assets instead of being embedded as data URLs. --- vite.config.mts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/vite.config.mts b/vite.config.mts index 66013c2f..d1132cd3 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -25,6 +25,7 @@ export default defineConfig(({ mode }) => { const env = loadEnv(mode, process.cwd()); return { base: env.VITE_BASE_URL || "/", + assetsInclude: ['**/*.wasm'], plugins: [ million.vite({ auto: true, mute: true }), handlebars({ @@ -123,6 +124,14 @@ export default defineConfig(({ mode }) => { build: { sourcemap: mode !== "production", + assetsInlineLimit: (filePath: string) => { + // Never inline WASM files + if (filePath.endsWith('.wasm')) { + return false; + } + // Use default 4KB limit for other assets + return undefined; + }, rollupOptions: { output: { manualChunks(id: string) {