Created
September 20, 2024 15:45
-
-
Save bogordesaincom/d0421c52117a3ae9a7b38500d044480d to your computer and use it in GitHub Desktop.
Bun
This file contains hidden or 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'; | |
| import path from 'path'; | |
| export default defineConfig({ | |
| plugins: [ | |
| react(), | |
| ], | |
| resolve: { | |
| alias: { | |
| '@': path.resolve(__dirname, './src'), | |
| }, | |
| }, | |
| build: { | |
| chunkSizeWarningLimit: 1500, | |
| manifest: true, | |
| reportCompressedSize: true, | |
| rollupOptions: { | |
| output: { | |
| manualChunks(id) { | |
| if (id.includes('react-router-dom')) { | |
| return 'react-router'; | |
| } | |
| if (id.includes('@tabler/icons-react')) { | |
| return 'tabler-icons-react'; | |
| } | |
| if (id.includes('@tanstack/react-table')) { | |
| return 'vendor-table'; | |
| } | |
| if (id.includes('recoil')) { | |
| return 'vendor-state-manager'; | |
| } | |
| if (id.includes('zod')) { | |
| return 'vendor-validation'; | |
| } | |
| if (id.includes('axios')) { | |
| return 'vendor-axios'; | |
| } | |
| if (id.includes('react-i18next')) { | |
| return 'vendor-i18next'; | |
| } | |
| if (id.includes('react-helmet-async')) { | |
| return 'vendor-helmet'; | |
| } | |
| if (id.includes('@easytool/react-permission')) { | |
| return 'vendor-permission'; | |
| } | |
| if (id.includes('embla-carousel-react')) { | |
| return 'vendor-carousel-react'; | |
| } | |
| if (id.includes('recharts')) { | |
| return 'vendor-chart'; | |
| } | |
| if (id.includes('xlsx')) { | |
| return 'vendor-sheet'; | |
| } | |
| if (id.includes('path')) { | |
| return 'vendor-path'; | |
| } | |
| if (id.includes('slugify')) { | |
| return 'vendor-slugify'; | |
| } | |
| if (id.includes('file-saver')) { | |
| return 'vendor-saver'; | |
| } | |
| if (id.includes('@mantine/dropzone')) { | |
| return 'vendor-dropzone'; | |
| } | |
| if (id.includes('@mantine/spotlight')) { | |
| return 'vendor-spotlight'; | |
| } | |
| if (id.includes('@mantine/charts')) { | |
| return 'vendor-xtra-charts'; | |
| } | |
| if (id.includes('i18next-fs-backend')) { | |
| return 'vendor-fs-i18next'; | |
| } | |
| if (id.includes('i18next-http-backend')) { | |
| return 'vendor-http-i18next'; | |
| } | |
| if (id.includes('swr')) { | |
| return 'vendor-swr'; | |
| } | |
| if (id.includes('uuid')) { | |
| return 'vendor-uuid'; | |
| } | |
| if (id.includes('@mantine/tiptap')) { | |
| return 'vendor-tiptap-theme'; | |
| } | |
| if (id.includes('@tiptap/react')) { | |
| return 'vendor-tiptap-react'; | |
| } | |
| if (id.includes('@tiptap/starter-kit')) { | |
| return 'vendor-tiptap-starter'; | |
| } | |
| if (id.includes('@tiptap/extension-placeholder')) { | |
| return 'vendor-tiptap-placeholder'; | |
| } | |
| if (id.includes('@react-pdf/renderer')) { | |
| return 'vendor-pdf'; | |
| } | |
| }, | |
| }, | |
| }, | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment