From 33b2d19cd04465a6e26f0f0d726e04371c5742d9 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 24 Nov 2023 18:36:37 -0600 Subject: [PATCH] vite: don't optimize wasmboy in dev (fixes devserver) --- vite.config.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index 4f93c42d3d..273ebb87b4 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -12,7 +12,7 @@ import { VitePWA } from 'vite-plugin-pwa'; import vitePluginRequire from 'vite-plugin-require'; import { viteStaticCopy } from 'vite-plugin-static-copy'; -export default defineConfig({ +export default defineConfig(({ command }) => ({ build: { assetsDir: 'packs', assetsInlineLimit: 0, @@ -29,6 +29,9 @@ export default defineConfig({ server: { port: 3036, }, + optimizeDeps: { + exclude: command === 'serve' ? ['@soapbox.pub/wasmboy'] : [], + }, plugins: [ checker({ typescript: true }), // @ts-ignore @@ -100,7 +103,7 @@ export default defineConfig({ environment: 'jsdom', setupFiles: 'src/jest/test-setup.ts', }, -}); +})); /** Return file as string, or return empty string if the file isn't found. */ function readFileContents(path: string) {