import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; import { fileURLToPath, URL } from 'node:url'; // The app is shared source with the React Native app: `frameUtils.ts` and // `skiaImage.ts` import `@shopify/react-native-skia`, and the alias below swaps // that for the CanvasKit adapter. Same trick the W0 spike used, now for the app. export default defineConfig({ plugins: [react()], resolve: { alias: { '@shopify/react-native-skia': fileURLToPath(new URL('./src/engine/skiaShim.ts', import.meta.url)), }, }, build: { target: 'es2022', // canvaskit-wasm's glue JS is ~2.5MB on its own; the wasm is fetched at // runtime from /wasm/, never bundled. chunkSizeWarningLimit: 9000, }, server: { port: 5173, proxy: { '/api': process.env.API_ORIGIN ?? 'http://localhost:3000' }, }, });