The desktop renderer is bundled as one chunk on purpose (codeSplitting: false) because Shiki's many dynamic chunks make electron-builder OOM scanning thousands of files. That makes the ~22 MB bundle expected, but Vite still nags with 'Some chunks are larger than 500 kB' on every build. Raise chunkSizeWarningLimit to 25000 kB so the cosmetic warning stays quiet while still firing as a regression alarm if the bundle grows well past today's size. Config-only; codeSplitting:false is untouched.
44 lines
1.4 KiB
TypeScript
44 lines
1.4 KiB
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
import path from 'path'
|
|
|
|
export default defineConfig({
|
|
base: './',
|
|
plugins: [react(), tailwindcss()],
|
|
build: {
|
|
// Keep desktop packaging stable: Shiki ships many dynamic chunks by
|
|
// default, and electron-builder can OOM scanning thousands of files.
|
|
// Collapsing to a single chunk is intentional, so the renderer bundle is
|
|
// large by design (~22 MB). Raise the warning ceiling above that so the
|
|
// cosmetic "chunk larger than 500 kB" nag stays quiet, while still acting
|
|
// as a regression alarm if the bundle balloons well past today's size.
|
|
chunkSizeWarningLimit: 25000,
|
|
rolldownOptions: {
|
|
output: {
|
|
codeSplitting: false
|
|
}
|
|
}
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
'@hermes/shared': path.resolve(__dirname, '../shared/src'),
|
|
react: path.resolve(__dirname, '../../node_modules/react'),
|
|
'react-dom': path.resolve(__dirname, '../../node_modules/react-dom'),
|
|
'react/jsx-dev-runtime': path.resolve(__dirname, '../../node_modules/react/jsx-dev-runtime.js'),
|
|
'react/jsx-runtime': path.resolve(__dirname, '../../node_modules/react/jsx-runtime.js')
|
|
},
|
|
dedupe: ['react', 'react-dom']
|
|
},
|
|
server: {
|
|
host: '127.0.0.1',
|
|
port: 5174,
|
|
strictPort: true
|
|
},
|
|
preview: {
|
|
host: '127.0.0.1',
|
|
port: 4174
|
|
}
|
|
})
|