judge4c-old-2/next.config.ts

33 lines
723 B
TypeScript

import type { NextConfig } from "next";
const nextConfig: NextConfig = {
images: {
remotePatterns: [
{
protocol: "https",
hostname: "avatars.githubusercontent.com",
},
{
protocol: "https",
hostname: "seccdn.libravatar.org",
},
{
protocol: "http",
hostname: "localhost",
},
],
},
webpack(config, { isServer }) {
// 仅在服务器端处理 .node 文件
if (isServer) {
config.module.rules.push({
test: /\.node$/,
use: 'node-loader', // 使用 node-loader 处理 .node 文件
});
}
return config;
},
};
export default nextConfig;