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:
@@ -4,6 +4,8 @@ import { Package, AlertTriangle } from "lucide-react";
|
||||
import { fetchServer } from "@/lib/api";
|
||||
import OrdersTable from "@/components/admin/OrdersTable";
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
interface Order {
|
||||
orderId: string | number;
|
||||
userId: string;
|
||||
|
||||
@@ -5,6 +5,8 @@ import { Server, Database, Cpu, HardDrive, Activity } from "lucide-react";
|
||||
import { fetchServer } from "@/lib/api";
|
||||
import SystemStatusCard from "@/components/admin/SystemStatusCard";
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
interface SystemStatus {
|
||||
uptimeSeconds: number;
|
||||
memory: {
|
||||
|
||||
@@ -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);
|
||||
|
||||
1296
package-lock.json
generated
1296
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -54,7 +54,7 @@
|
||||
"input-otp": "1.4.1",
|
||||
"jwt-decode": "^4.0.0",
|
||||
"lucide-react": "^0.454.0",
|
||||
"next": "^15.2.6",
|
||||
"next": "^16.1.1",
|
||||
"next-themes": "latest",
|
||||
"react": "^19.0.0",
|
||||
"react-day-picker": "8.10.1",
|
||||
@@ -73,7 +73,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@distube/ytdl-core": "^4.16.12",
|
||||
"@next/bundle-analyzer": "^15.4.6",
|
||||
"@next/bundle-analyzer": "^16.1.1",
|
||||
"@tailwindcss/typography": "^0.5.16",
|
||||
"@types/lodash": "^4.17.16",
|
||||
"@types/node": "^22",
|
||||
@@ -81,7 +81,7 @@
|
||||
"@types/react-dom": "^18",
|
||||
"cross-env": "^7.0.3",
|
||||
"eslint": "^9.19.0",
|
||||
"eslint-config-next": "^15.2.3",
|
||||
"eslint-config-next": "^16.1.1",
|
||||
"postcss": "^8",
|
||||
"tailwindcss": "^3.4.17",
|
||||
"typescript": "^5"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"commitHash": "18ac222",
|
||||
"buildTime": "2025-12-31T06:46:19.353Z"
|
||||
"commitHash": "66e9543",
|
||||
"buildTime": "2025-12-31T07:04:51.067Z"
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
"moduleResolution": "bundler",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"jsx": "preserve",
|
||||
"jsx": "react-jsx",
|
||||
"incremental": true,
|
||||
"plugins": [
|
||||
{
|
||||
@@ -32,7 +32,8 @@
|
||||
"next-env.d.ts",
|
||||
"**/*.ts",
|
||||
"**/*.tsx",
|
||||
".next/types/**/*.ts"
|
||||
".next/types/**/*.ts",
|
||||
".next/dev/types/**/*.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
|
||||
Reference in New Issue
Block a user