Skip to content

Instantly share code, notes, and snippets.

@VlatkoStojkoski
Created February 29, 2024 00:06
Show Gist options
  • Save VlatkoStojkoski/0303405953f3eb983fa2401a30f77548 to your computer and use it in GitHub Desktop.
Save VlatkoStojkoski/0303405953f3eb983fa2401a30f77548 to your computer and use it in GitHub Desktop.
next.config.ts #1
/** @type {import('next').NextConfig} */
const path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin');
/** @type {import('next').NextConfig} */
const nextConfig = {
webpack: (config, { isServer }) => {
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, '.next'),
},
],
})
);
}
// 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