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 { fetchServer } from "@/lib/api";
|
||||||
import OrdersTable from "@/components/admin/OrdersTable";
|
import OrdersTable from "@/components/admin/OrdersTable";
|
||||||
|
|
||||||
|
export const dynamic = 'force-dynamic';
|
||||||
|
|
||||||
interface Order {
|
interface Order {
|
||||||
orderId: string | number;
|
orderId: string | number;
|
||||||
userId: string;
|
userId: string;
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import { Server, Database, Cpu, HardDrive, Activity } from "lucide-react";
|
|||||||
import { fetchServer } from "@/lib/api";
|
import { fetchServer } from "@/lib/api";
|
||||||
import SystemStatusCard from "@/components/admin/SystemStatusCard";
|
import SystemStatusCard from "@/components/admin/SystemStatusCard";
|
||||||
|
|
||||||
|
export const dynamic = 'force-dynamic';
|
||||||
|
|
||||||
interface SystemStatus {
|
interface SystemStatus {
|
||||||
uptimeSeconds: number;
|
uptimeSeconds: number;
|
||||||
memory: {
|
memory: {
|
||||||
|
|||||||
@@ -51,6 +51,14 @@ const baseConfig = {
|
|||||||
} : false,
|
} : false,
|
||||||
},
|
},
|
||||||
poweredByHeader: 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 }) => {
|
webpack: (config, { isServer, dev }) => {
|
||||||
if (!isServer && !dev) {
|
if (!isServer && !dev) {
|
||||||
// Only apply aggressive code splitting in production
|
// Only apply aggressive code splitting in production
|
||||||
@@ -112,9 +120,9 @@ const baseConfig = {
|
|||||||
typescript: {
|
typescript: {
|
||||||
ignoreBuildErrors: true,
|
ignoreBuildErrors: true,
|
||||||
},
|
},
|
||||||
eslint: {
|
// Turbopack configuration for optimal bundle sizes
|
||||||
ignoreDuringBuilds: true,
|
// Turbopack automatically handles code splitting and tree-shaking
|
||||||
},
|
turbopack: {},
|
||||||
};
|
};
|
||||||
|
|
||||||
const nextConfig = withBundleAnalyzer(baseConfig);
|
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",
|
"input-otp": "1.4.1",
|
||||||
"jwt-decode": "^4.0.0",
|
"jwt-decode": "^4.0.0",
|
||||||
"lucide-react": "^0.454.0",
|
"lucide-react": "^0.454.0",
|
||||||
"next": "^15.2.6",
|
"next": "^16.1.1",
|
||||||
"next-themes": "latest",
|
"next-themes": "latest",
|
||||||
"react": "^19.0.0",
|
"react": "^19.0.0",
|
||||||
"react-day-picker": "8.10.1",
|
"react-day-picker": "8.10.1",
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@distube/ytdl-core": "^4.16.12",
|
"@distube/ytdl-core": "^4.16.12",
|
||||||
"@next/bundle-analyzer": "^15.4.6",
|
"@next/bundle-analyzer": "^16.1.1",
|
||||||
"@tailwindcss/typography": "^0.5.16",
|
"@tailwindcss/typography": "^0.5.16",
|
||||||
"@types/lodash": "^4.17.16",
|
"@types/lodash": "^4.17.16",
|
||||||
"@types/node": "^22",
|
"@types/node": "^22",
|
||||||
@@ -81,7 +81,7 @@
|
|||||||
"@types/react-dom": "^18",
|
"@types/react-dom": "^18",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
"eslint": "^9.19.0",
|
"eslint": "^9.19.0",
|
||||||
"eslint-config-next": "^15.2.3",
|
"eslint-config-next": "^16.1.1",
|
||||||
"postcss": "^8",
|
"postcss": "^8",
|
||||||
"tailwindcss": "^3.4.17",
|
"tailwindcss": "^3.4.17",
|
||||||
"typescript": "^5"
|
"typescript": "^5"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"commitHash": "18ac222",
|
"commitHash": "66e9543",
|
||||||
"buildTime": "2025-12-31T06:46:19.353Z"
|
"buildTime": "2025-12-31T07:04:51.067Z"
|
||||||
}
|
}
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
"moduleResolution": "bundler",
|
"moduleResolution": "bundler",
|
||||||
"resolveJsonModule": true,
|
"resolveJsonModule": true,
|
||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
"jsx": "preserve",
|
"jsx": "react-jsx",
|
||||||
"incremental": true,
|
"incremental": true,
|
||||||
"plugins": [
|
"plugins": [
|
||||||
{
|
{
|
||||||
@@ -32,7 +32,8 @@
|
|||||||
"next-env.d.ts",
|
"next-env.d.ts",
|
||||||
"**/*.ts",
|
"**/*.ts",
|
||||||
"**/*.tsx",
|
"**/*.tsx",
|
||||||
".next/types/**/*.ts"
|
".next/types/**/*.ts",
|
||||||
|
".next/dev/types/**/*.ts"
|
||||||
],
|
],
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules"
|
"node_modules"
|
||||||
|
|||||||
Reference in New Issue
Block a user