diff --git a/next.config.ts b/next.config.ts index 7ea9c4f..497ffa7 100644 --- a/next.config.ts +++ b/next.config.ts @@ -1,17 +1,7 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { - /* config options here */ - webpack(config, { isServer }) { - // 仅在服务器端处理 .node 文件 - if (isServer) { - config.module.rules.push({ - test: /\.node$/, - use: 'node-loader', // 使用 node-loader 处理 .node 文件 - }); - } - return config; - }, + serverExternalPackages: ["dockerode"], }; export default nextConfig; diff --git a/package.json b/package.json index 424c613..aaaa082 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "axios": "^1.7.9", "dockerode": "^4.0.2", "next": "15.1.3", + "nextjs-node-loader": "^1.1.9", "react": "^19.0.0", "react-dom": "^19.0.0" }, @@ -29,7 +30,6 @@ "eslint-config-next": "15.1.3", "html-webpack-plugin": "^5.6.3", "jest": "^29.7.0", - "node-loader": "^2.1.0", "postcss": "^8", "tailwindcss": "^3.4.1", "ts-jest": "^29.2.5", diff --git a/src/app/layout.tsx b/src/app/layout.tsx index f7fa87e..e9454a2 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -23,7 +23,7 @@ export default function RootLayout({ children: React.ReactNode; }>) { return ( - +