openai-harmony/demo/harmony-demo/next.config.ts
Dominik Kundel 253cdca537 Initial commit
Co-authored-by: scott-oai <142930063+scott-oai@users.noreply.github.com>
Co-authored-by: Zhuohan Li <zhuohan@openai.com>
2025-08-05 08:42:25 -07:00

30 lines
1,008 B
TypeScript

import type { NextConfig } from "next";
const nextConfig: NextConfig = {
webpack(config, { isServer, dev, webpack }) {
// Use the client static directory in the server bundle and prod mode
// Fixes `Error occurred prerendering page "/"`
config.output.webassemblyModuleFilename =
isServer && !dev
? "../static/[modulehash].wasm"
: "static/[modulehash].wasm";
// Since Webpack 5 doesn't enable WebAssembly by default, we should do it manually
config.experiments = { ...config.experiments, asyncWebAssembly: true };
// https://nextjs.org/docs/app/building-your-application/optimizing/memory-usage#disable-webpack-cache
// This just stops building altogether:
// if (config.cache && !dev) {
// config.cache = Object.freeze({
// type: 'memory',
// })
// }
// Deubbing (vercel/next.js/issues/27650)
config.infrastructureLogging = { debug: /PackFileCache/ };
return config;
},
};
export default nextConfig;