28 lines
730 B
TypeScript
28 lines
730 B
TypeScript
import type { NextConfig } from "next";
|
|
|
|
const nextConfig: NextConfig = {
|
|
// Turbopack config (Next.js 16 default)
|
|
turbopack: {
|
|
resolveAlias: {
|
|
// Optional ML backends — not installed, dynamic import fallback to mock
|
|
"@tensorflow/tfjs": "./src/stubs/empty.ts",
|
|
"@tensorflow/tfjs-node": "./src/stubs/empty.ts",
|
|
"onnxruntime-node": "./src/stubs/empty.ts",
|
|
},
|
|
},
|
|
// Webpack config (fallback)
|
|
webpack: (config) => {
|
|
config.resolve.alias = {
|
|
...config.resolve.alias,
|
|
sharp: false,
|
|
"detect-libc": false,
|
|
"@tensorflow/tfjs": false,
|
|
"@tensorflow/tfjs-node": false,
|
|
"onnxruntime-node": false,
|
|
};
|
|
return config;
|
|
},
|
|
};
|
|
|
|
export default nextConfig;
|