's'
This commit is contained in:
@@ -3,6 +3,14 @@ const nextConfig = {
|
|||||||
// Docker 部署支持
|
// Docker 部署支持
|
||||||
// output: 'standalone',
|
// output: 'standalone',
|
||||||
|
|
||||||
|
// 低配 VPS:降低 webpack 并行度,减少构建峰值内存(构建会变慢)
|
||||||
|
webpack: (config, { dev }) => {
|
||||||
|
if (!dev) {
|
||||||
|
config.parallelism = 1;
|
||||||
|
}
|
||||||
|
return config;
|
||||||
|
},
|
||||||
|
|
||||||
images: {
|
images: {
|
||||||
domains: [
|
domains: [
|
||||||
"dash.cloudflare.com",
|
"dash.cloudflare.com",
|
||||||
@@ -34,6 +42,43 @@ const nextConfig = {
|
|||||||
serverActions: {
|
serverActions: {
|
||||||
allowedOrigins: ["localhost", "navsphere.com", "*.hackrobot.cn"],
|
allowedOrigins: ["localhost", "navsphere.com", "*.hackrobot.cn"],
|
||||||
},
|
},
|
||||||
|
// 按需解析 barrel 导出,减轻构建时 AST/模块图压力
|
||||||
|
optimizePackageImports: [
|
||||||
|
"lucide-react",
|
||||||
|
"date-fns",
|
||||||
|
"recharts",
|
||||||
|
"@tanstack/react-table",
|
||||||
|
"@tanstack/react-query",
|
||||||
|
"@hello-pangea/dnd",
|
||||||
|
"@radix-ui/react-accordion",
|
||||||
|
"@radix-ui/react-alert-dialog",
|
||||||
|
"@radix-ui/react-aspect-ratio",
|
||||||
|
"@radix-ui/react-avatar",
|
||||||
|
"@radix-ui/react-checkbox",
|
||||||
|
"@radix-ui/react-collapsible",
|
||||||
|
"@radix-ui/react-context-menu",
|
||||||
|
"@radix-ui/react-dialog",
|
||||||
|
"@radix-ui/react-dropdown-menu",
|
||||||
|
"@radix-ui/react-hover-card",
|
||||||
|
"@radix-ui/react-label",
|
||||||
|
"@radix-ui/react-menubar",
|
||||||
|
"@radix-ui/react-navigation-menu",
|
||||||
|
"@radix-ui/react-popover",
|
||||||
|
"@radix-ui/react-progress",
|
||||||
|
"@radix-ui/react-radio-group",
|
||||||
|
"@radix-ui/react-scroll-area",
|
||||||
|
"@radix-ui/react-select",
|
||||||
|
"@radix-ui/react-separator",
|
||||||
|
"@radix-ui/react-slider",
|
||||||
|
"@radix-ui/react-slot",
|
||||||
|
"@radix-ui/react-switch",
|
||||||
|
"@radix-ui/react-tabs",
|
||||||
|
"@radix-ui/react-toast",
|
||||||
|
"@radix-ui/react-toggle",
|
||||||
|
"@radix-ui/react-toggle-group",
|
||||||
|
"@radix-ui/react-toolbar",
|
||||||
|
"@radix-ui/react-tooltip",
|
||||||
|
],
|
||||||
},
|
},
|
||||||
// 加在这句话就够了
|
// 加在这句话就够了
|
||||||
generateBuildId: async () => {
|
generateBuildId: async () => {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
"build": "next build",
|
"build": "node --max-old-space-size=2048 ./node_modules/next/dist/bin/next build",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
"lint": "next lint",
|
"lint": "next lint",
|
||||||
"clean": "rm -rf .next",
|
"clean": "rm -rf .next",
|
||||||
|
|||||||
Reference in New Issue
Block a user