diff --git a/vite.config.ts b/vite.config.ts index 4f93c42d3..273ebb87b 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) {