6044f8da7c
Replaced Bun's client bundler with Vite to fix code splitting issues. Extracted React and Excalidraw into their own manual chunks to prevent the monolithic 7MB index.js from blocking rendering. FCP decreased significantly since browsers can now cache these chunks independently.
23 lines
519 B
TypeScript
23 lines
519 B
TypeScript
import { defineConfig } from 'vite';
|
|
|
|
export default defineConfig({
|
|
root: 'src',
|
|
build: {
|
|
outDir: '../dist/public',
|
|
emptyOutDir: true,
|
|
rollupOptions: {
|
|
input: 'src/index.html',
|
|
output: {
|
|
manualChunks(id) {
|
|
if (id.includes('node_modules/react') || id.includes('node_modules/react-dom')) {
|
|
return 'react';
|
|
}
|
|
if (id.includes('node_modules/@excalidraw/excalidraw')) {
|
|
return 'excalidraw';
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|