|
import type { NextConfig } from "next"; |
|
|
|
import path from "path"; |
|
import { fileURLToPath } from 'url'; |
|
|
|
const __filename = fileURLToPath(import.meta.url); |
|
const __dirname = path.dirname(__filename); |
|
|
|
const nextConfig: NextConfig = { |
|
|
|
output: 'standalone', |
|
serverExternalPackages: ['sharp', 'onnxruntime-node'], |
|
webpack: (config) => { |
|
config.resolve.alias['@huggingface/transformers'] = path.resolve(__dirname, 'node_modules/@huggingface/transformers'); |
|
config.resolve.alias = { |
|
...config.resolve.alias, |
|
"sharp$": false, |
|
"onnxruntime-node$": false, |
|
} |
|
return config; |
|
}, |
|
|
|
}; |
|
|
|
export default nextConfig; |
|
|