Enable dynamic rendering and update Next.js config

Added 'force-dynamic' export to admin orders and status pages for dynamic rendering. Updated next.config.mjs to modularize imports for better tree-shaking and switched to Turbopack for optimal bundle sizes. Upgraded Next.js and related dependencies in package.json and package-lock.json.
This commit is contained in:
g
2025-12-31 07:05:26 +00:00
parent 66e95438fe
commit c31604d29a
7 changed files with 932 additions and 397 deletions

View File

@@ -51,6 +51,14 @@ const baseConfig = {
} : false,
},
poweredByHeader: false,
// Modularize imports for better tree-shaking (only for libraries that benefit from it)
modularizeImports: {
// date-fns: function-level imports for better tree-shaking
'date-fns': {
transform: 'date-fns/{{member}}',
},
},
// Webpack config (fallback if using --webpack flag)
webpack: (config, { isServer, dev }) => {
if (!isServer && !dev) {
// Only apply aggressive code splitting in production
@@ -112,9 +120,9 @@ const baseConfig = {
typescript: {
ignoreBuildErrors: true,
},
eslint: {
ignoreDuringBuilds: true,
},
// Turbopack configuration for optimal bundle sizes
// Turbopack automatically handles code splitting and tree-shaking
turbopack: {},
};
const nextConfig = withBundleAnalyzer(baseConfig);