update next.config.mjs

This commit is contained in:
Hk-Gosuto 2024-08-28 10:37:13 +08:00
parent 7391275fb3
commit e41b2d91b6

View File

@ -8,6 +8,10 @@ console.log("[Next] build with chunk: ", !disableChunk);
/** @type {import('next').NextConfig} */ /** @type {import('next').NextConfig} */
const nextConfig = { const nextConfig = {
env: {
LANGCHAIN_CALLBACKS_BACKGROUND: true,
},
webpack(config) { webpack(config) {
config.module.rules.push({ config.module.rules.push({
test: /\.svg$/, test: /\.svg$/,
@ -16,7 +20,7 @@ const nextConfig = {
if (disableChunk) { if (disableChunk) {
config.plugins.push( config.plugins.push(
new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1 }), new webpack.optimize.LimitChunkCountPlugin({ maxChunks: 1 })
); );
} }
@ -24,12 +28,6 @@ const nextConfig = {
child_process: false, child_process: false,
}; };
config.plugins.push(
new webpack.DefinePlugin({
'process.env.NEXT_PUBLIC_LANGCHAIN_CALLBACKS_BACKGROUND': true
})
);
return config; return config;
}, },
output: mode, output: mode,
@ -77,8 +75,10 @@ if (mode !== "export") {
}, },
{ {
// https://{resource_name}.openai.azure.com/openai/deployments/{deploy_name}/chat/completions // https://{resource_name}.openai.azure.com/openai/deployments/{deploy_name}/chat/completions
source: "/api/proxy/azure/:resource_name/deployments/:deploy_name/:path*", source:
destination: "https://:resource_name.openai.azure.com/openai/deployments/:deploy_name/:path*", "/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*", source: "/api/proxy/google/:path*",