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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user