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