️(frontend) improve bundle size

Improve bundle size by improving tree shaking
and code splitting.
This commit is contained in:
Anthony LC
2026-03-12 10:00:04 +01:00
parent 27c5e0ce5a
commit 11d899437a
32 changed files with 195 additions and 63 deletions

View File

@@ -15,6 +15,12 @@ const nextConfig = {
// Enables the styled-components SWC transform
styledComponents: true,
},
experimental: {
// Tree-shake barrel files for these packages so webpack only bundles the
// symbols that are actually imported, reducing chunk sizes noticeably for
// Mantine and the Cunningham design system.
optimizePackageImports: ['@mantine/core', '@mantine/hooks', 'lodash'],
},
generateBuildId: () => buildId,
env: {
NEXT_PUBLIC_BUILD_ID: buildId,