/** * ============================================================================ * NEXT.JS CONFIG HELPERS * ============================================================================ * * Helpers for configuring Next.js projects using Plyaz packages. * These handle common webpack fallbacks, server external packages, and other * configurations needed when using @plyaz/core and related packages. * * @example * ```typescript * // next.config.ts * import { withPlyazNextConfig } from '@plyaz/core/frameworks/nextjs'; * * export default withPlyazNextConfig({ * experimental: { * serverActions: { bodySizeLimit: '100mb' }, * }, * }); * ``` */ import type { NextConfig } from 'next'; import type { CorePlyazNextConfigOptions } from '@plyaz/types/core'; /** * Packages that should be externalized from the server bundle. * These are packages with native dependencies or server-only code. */ export declare const plyazServerExternalPackages: readonly ["@plyaz/core", "@plyaz/storage", "@plyaz/notifications", "@plyaz/db", "@nestjs/common", "@nestjs/core", "@nestjs/platform-express", "reflect-metadata", "playwright", "playwright-core", "puppeteer", "puppeteer-core", "sharp", "file-type", "load-esm", "ioredis"]; /** * Webpack fallbacks for client-side bundling. * These stub out Node.js modules that might leak into the frontend bundle. */ export declare const plyazWebpackClientFallbacks: { readonly dns: false; readonly net: false; readonly tls: false; readonly fs: false; readonly child_process: false; readonly async_hooks: false; readonly perf_hooks: false; }; /** * Packages to alias to false for client-side bundling. * These are backend-only packages that should never be in the client bundle. */ export declare const plyazWebpackClientAliases: { readonly ioredis: false; }; /** * Wraps a Next.js config with Plyaz-specific settings. * * This function adds: * - Server external packages for @plyaz/* and native modules * - Webpack client fallbacks for Node.js modules * - Webpack client aliases for backend-only packages * * @param config - Your Next.js configuration * @param options - Optional Plyaz-specific options * @returns The wrapped Next.js configuration * * @example * ```typescript * // Basic usage * import { withPlyazNextConfig } from '@plyaz/core/frameworks/nextjs'; * * export default withPlyazNextConfig({ * experimental: { * serverActions: { bodySizeLimit: '100mb' }, * }, * }); * * // With next-intl or other plugins * import createNextIntlPlugin from 'next-intl/plugin'; * * const withNextIntl = createNextIntlPlugin(); * export default withNextIntl(withPlyazNextConfig({ ... })); * * // With custom options * export default withPlyazNextConfig( * { ... }, * { * additionalExternalPackages: ['my-native-package'], * additionalClientFallbacks: { http: false }, * } * ); * ``` */ export declare function withPlyazNextConfig(config: NextConfig, options?: CorePlyazNextConfigOptions): NextConfig; //# sourceMappingURL=config.d.ts.map