Skip to content
Snippets Groups Projects
Unverified Commit cb2dc802 authored by Thuc Pham's avatar Thuc Pham Committed by GitHub
Browse files

docs: update next config for external packages (#759)

parent 5a6cc0e3
No related branches found
No related tags found
No related merge requests found
...@@ -114,14 +114,21 @@ Add the following config to your `next.config.js` to ignore specific packages in ...@@ -114,14 +114,21 @@ Add the following config to your `next.config.js` to ignore specific packages in
/** @type {import('next').NextConfig} */ /** @type {import('next').NextConfig} */
const nextConfig = { const nextConfig = {
experimental: { experimental: {
serverComponentsExternalPackages: ["pdf2json", "@zilliz/milvus2-sdk-node"], serverComponentsExternalPackages: [
"pdf2json",
"@zilliz/milvus2-sdk-node",
"sharp",
"onnxruntime-node",
],
}, },
webpack: (config) => { webpack: (config) => {
config.resolve.alias = { config.externals.push({
...config.resolve.alias, pdf2json: "commonjs pdf2json",
sharp$: false, "@zilliz/milvus2-sdk-node": "commonjs @zilliz/milvus2-sdk-node",
"onnxruntime-node$": false, sharp: "commonjs sharp",
}; "onnxruntime-node": "commonjs onnxruntime-node",
});
return config; return config;
}, },
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment