Created
February 29, 2024 00:06
-
-
Save VlatkoStojkoski/0303405953f3eb983fa2401a30f77548 to your computer and use it in GitHub Desktop.
next.config.ts #1
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 }) => { | |
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