Created
February 29, 2024 00:06
-
-
Save VlatkoStojkoski/c6caff7b6492d3e799f539ac8c0bfc27 to your computer and use it in GitHub Desktop.
next.config.ts #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @type {import('next').NextConfig} */ | |
const path = require('path'); | |
const CopyWebpackPlugin = require('copy-webpack-plugin'); | |
/** @type {import('next').NextConfig} */ | |
const nextConfig = { | |
webpack: (config, { isServer, dev }) => { | |
if (isServer) { | |
// Copy the proto files to the server build directory | |
config.plugins.push( | |
new CopyWebpackPlugin({ | |
patterns: [ | |
{ | |
from: path.join( | |
__dirname, | |
'node_modules/@zilliz/milvus2-sdk-node/dist' | |
), | |
to: path.join(__dirname, dev ? '.next' : '.next/server/app'), | |
}, | |
], | |
}) | |
); | |
} | |
// Important: return the modified config | |
return config; | |
}, | |
}; | |
module.exports = nextConfig; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment