Skip to content

Instantly share code, notes, and snippets.

@VlatkoStojkoski
Created February 29, 2024 00:06
Show Gist options
  • Save VlatkoStojkoski/c6caff7b6492d3e799f539ac8c0bfc27 to your computer and use it in GitHub Desktop.
Save VlatkoStojkoski/c6caff7b6492d3e799f539ac8c0bfc27 to your computer and use it in GitHub Desktop.
next.config.ts #2
/** @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