Split build into smaller chunks

This commit is contained in:
Piotr Rogowski 2022-02-26 00:34:14 +01:00
parent 85822bd375
commit 2498b10008
No known key found for this signature in database
GPG Key ID: 4A842D702D9C6F8F
2 changed files with 26 additions and 2 deletions

View File

@ -1,6 +1,7 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"cSpell.words": [
"kbar",
"vite",
"vitejs"
]

View File

@ -4,8 +4,31 @@ import { visualizer } from 'rollup-plugin-visualizer';
// https://vitejs.dev/config/
export default defineConfig({
// This changes the out put dir from dist to build
build: { outDir: 'build' },
build: {
outDir: 'build', // This changes the out put dir from dist to build
rollupOptions: {
output: {
manualChunks: {
firebase: [
'firebase/app',
'firebase/performance',
'firebase/auth',
'firebase/analytics',
'firebase/storage',
'firebase/firestore/lite',
],
react: ['react', 'react-dom'],
antdResult: ['antd/es/result'],
antdTable: ['antd/es/table'],
antdIcons: ['@ant-design/icons'],
uplot: ['uplot'],
sentry: ['@sentry/react', '@sentry/browser', '@sentry/tracing'],
kbar: ['kbar'],
perfectScrollbar: ['perfect-scrollbar'],
},
},
},
},
server: { open: true },
css: {
preprocessorOptions: {