Created
February 5, 2025 00:15
-
-
Save ccthecode/5d5c9cb57f93fe6463a516f57ab65f31 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { defineConfig } from 'vite'; | |
import react from '@vitejs/plugin-react'; | |
// https://vitejs.dev/config/ | |
export default defineConfig({ | |
plugins: [react()], | |
optimizeDeps: { | |
exclude: ['lucide-react'], | |
}, | |
build: { | |
chunkSizeWarningLimit: 1800, | |
rollupOptions: { | |
output: { | |
manualChunks(id: string) { | |
if (id.indexOf('node_modules') !== -1) { | |
const basic = id.toString().split('node_modules/')[1]; | |
const sub1 = basic.split('/')[0]; | |
if (sub1 !== '.pnpm') { | |
return sub1.toString(); | |
} | |
const name2 = basic.split('/')[1]; | |
return name2.split('@')[name2[0] === '@' ? 1 : 0].toString(); | |
} | |
} | |
} | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment