This commit is contained in:
@@ -6,26 +6,45 @@ export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, process.cwd());
|
||||
return {
|
||||
build: {
|
||||
rollupOptions: {
|
||||
rolldownOptions: {
|
||||
output: {
|
||||
manualChunks: {
|
||||
reactIcons: ['react-icons/fi', 'react-icons/fa', 'react-icons/wi'],
|
||||
reactIconsSi: ['react-icons/si'],
|
||||
reactIconsFa6: ['react-icons/fa6'],
|
||||
reactIconsVsc: ['react-icons/vsc'],
|
||||
mantine: [
|
||||
'@mantine/core',
|
||||
'@mantine/form',
|
||||
'@mantine/hooks',
|
||||
'@mantine/notifications',
|
||||
],
|
||||
tanstack: [
|
||||
'@tanstack/react-query',
|
||||
'@tanstack/react-query-devtools',
|
||||
'@tanstack/react-query-persist-client',
|
||||
],
|
||||
recharts: ['recharts'],
|
||||
utils: ['@hello-pangea/dnd', 'jotai'],
|
||||
codeSplitting: {
|
||||
maxSize: 5000000,
|
||||
groups: [
|
||||
{
|
||||
name: 'reactIcons',
|
||||
test: /[\\/]react-icons\/(fi|fa|wi)[\\/]/,
|
||||
},
|
||||
{
|
||||
name: 'reactIconsSi',
|
||||
test: /[\\/]react-icons\/(si)[\\/]/,
|
||||
},
|
||||
{
|
||||
name: 'reactIconsFa6',
|
||||
test: /[\\/]react-icons\/(fa6)[\\/]/,
|
||||
},
|
||||
{
|
||||
name: 'reactIconsVsc',
|
||||
test: /[\\/]react-icons\/(vsc)[\\/]/,
|
||||
},
|
||||
{
|
||||
name: (moduleId) => moduleId.includes('mantine') ? 'mantine' : null,
|
||||
},
|
||||
{
|
||||
name: (moduleId) => moduleId.includes('tanstack') ? 'tanstack' : null,
|
||||
},
|
||||
{
|
||||
name: 'recharts',
|
||||
test: /[\\/]recharts[\\/]/
|
||||
},
|
||||
{
|
||||
name: (moduleId) => moduleId.includes('utils') || moduleId.includes('dnd') ? 'utils' : null,
|
||||
},
|
||||
{
|
||||
name: 'main',
|
||||
test: /[\\/]src[\\/]/,
|
||||
},
|
||||
]
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user