/** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, swcMinify: true, // Standalone-Output für den HF-Space-Dockerfile-Runner output: 'standalone', // PWA Configuration headers: async () => [ { source: '/(.*)', headers: [ { key: 'Cross-Origin-Embedder-Policy', value: 'require-corp', }, { key: 'Cross-Origin-Opener-Policy', value: 'same-origin', }, ], }, ], // Webpack configuration for WASM support webpack: (config, { isServer }) => { // WASM-Dateien als Assets behandeln (Emscripten/onnxruntime lädt sie zur Laufzeit selbst) config.module.rules.unshift({ test: /\.wasm$/, type: 'asset/resource', }) // onnxruntime-Bundles enthalten import.meta, das Terser nicht minifizieren kann // → Minifizierung global deaktivieren (lokale App, Bundle-Größe zweitrangig) config.optimization.minimize = false // Ignore node-specific modules in client bundles if (!isServer) { config.resolve.fallback = { ...config.resolve.fallback, fs: false, path: false, crypto: false, } } return config }, } module.exports = nextConfig