/** * Next.js Config Wrapper * * Provides `withNextly()` to automatically configure Next.js for * compatibility with Nextly's server-side packages. This prevents * bundler errors (e.g., "Cannot find package 'pg'") on Vercel and * other serverless platforms. * * @module nextly/next * @since 1.0.0 * * @example * ```typescript * // next.config.ts * import { withNextly } from "nextly/next"; * * export default withNextly({ * // your Next.js config * }); * ``` */ /** * Wraps a Next.js config to add Nextly-required settings. * * Automatically adds server-external packages so database drivers * and adapters are loaded from node_modules at runtime instead of * being bundled (which fails on serverless platforms like Vercel). * * @param nextConfig - Your Next.js configuration * @returns Enhanced Next.js configuration with Nextly compatibility * * @example * ```typescript * // next.config.ts * import { withNextly } from "nextly/next"; * * export default withNextly({ * images: { * remotePatterns: [{ hostname: "example.com" }], * }, * }); * ``` * * @example With other plugins * ```typescript * import { withNextly } from "nextly/next"; * * const nextConfig = { * reactCompiler: true, * }; * * export default withNextly(nextConfig); * ``` */ declare function withNextly>(nextConfig: T): T; export { withNextly };