import type { NextConfig } from "next"; import path from "node:path"; const root = __dirname; const nextConfig: NextConfig = { allowedDevOrigins: ["127.0.0.1", "localhost"], transpilePackages: ["three", "three-mesh-bvh"], webpack(config) { config.resolve = config.resolve || {}; config.resolve.alias = { ...(config.resolve.alias || {}), "@": path.join(root, "src"), three: path.join(root, "node_modules", "three"), "three/examples": path.join(root, "node_modules", "three", "examples"), "three-mesh-bvh": path.join(root, "node_modules", "three-mesh-bvh"), }; config.resolve.extensions = [ ...(config.resolve.extensions || []), ".js", ".mjs", ]; return config; }, }; export default nextConfig;