vite.config.ts (804B)
1 import { defineConfig, splitVendorChunkPlugin } from 'vite'; 2 import react from "@vitejs/plugin-react-swc"; 3 import { ViteEjsPlugin } from "vite-plugin-ejs"; 4 5 // https://vitejs.dev/config/ 6 export default defineConfig({ 7 build: { 8 sourcemap: true, 9 }, 10 plugins: [ 11 react(), 12 splitVendorChunkPlugin(), 13 ViteEjsPlugin((viteConfig) => ({ 14 // viteConfig is the current Vite resolved config 15 env: viteConfig.env, 16 })), 17 ], 18 resolve: { 19 dedupe: [ 20 "react", 21 "react-dom", 22 "matrix-js-sdk", 23 ] 24 }, 25 worker: { 26 format: 'iife', 27 }, 28 test: { 29 globals: true, 30 environment: 'jsdom', 31 setupFiles: './src/test/setup.ts', 32 // you might want to disable it, if you don't have tests that rely on CSS 33 // since parsing CSS is slow 34 css: true, 35 } 36 });