Spaces:
Running
Running
| import { defineConfig } from 'vite'; | |
| import react from '@vitejs/plugin-react'; | |
| // https://vitejs.dev/config/ | |
| export default defineConfig({ | |
| plugins: [react()], | |
| server: { | |
| port: 3000, | |
| headers: { | |
| // Required for WebGPU | |
| 'Cross-Origin-Opener-Policy': 'same-origin', | |
| 'Cross-Origin-Embedder-Policy': 'require-corp', | |
| }, | |
| }, | |
| optimizeDeps: { | |
| exclude: ['@huggingface/transformers', 'parakeet.js'], | |
| }, | |
| worker: { | |
| format: 'es', // Use ES modules for workers | |
| }, | |
| build: { | |
| target: 'esnext', | |
| rollupOptions: { | |
| output: { | |
| manualChunks: { | |
| 'parakeet': ['parakeet.js'], | |
| 'onnxruntime': ['onnxruntime-web'], | |
| }, | |
| }, | |
| }, | |
| }, | |
| }); | |