diff --git a/next.config.mjs b/next.config.mjs index e965a1807..bd73bed15 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -8,6 +8,10 @@ console.log("[Next] build with chunk: ", !disableChunk); /** @type {import('next').NextConfig} */ const nextConfig = { + env: { + LANGCHAIN_CALLBACKS_BACKGROUND: true, + }, + webpack(config) { config.module.rules.push({ test: /\.svg$/, @@ -16,20 +20,14 @@ const nextConfig = { if (disableChunk) { config.plugins.push( - new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1 }), + new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1 }) ); } config.resolve.fallback = { child_process: false, }; - - config.plugins.push( - new webpack.DefinePlugin({ - 'process.env.NEXT_PUBLIC_LANGCHAIN_CALLBACKS_BACKGROUND': true - }) - ); - + return config; }, output: mode, @@ -77,8 +75,10 @@ if (mode !== "export") { }, { // https://{resource_name}.openai.azure.com/openai/deployments/{deploy_name}/chat/completions - source: "/api/proxy/azure/:resource_name/deployments/:deploy_name/:path*", - destination: "https://:resource_name.openai.azure.com/openai/deployments/:deploy_name/:path*", + source: + "/api/proxy/azure/:resource_name/deployments/:deploy_name/:path*", + destination: + "https://:resource_name.openai.azure.com/openai/deployments/:deploy_name/:path*", }, { source: "/api/proxy/google/:path*", @@ -108,4 +108,4 @@ if (mode !== "export") { }; } -export default nextConfig; \ No newline at end of file +export default nextConfig;