import type { StyleXPluginOption } from '@stylexswc/rspack-plugin'; import type { NextConfig } from 'next/dist/server/config-shared'; export interface StyleXNextRspackPluginOption extends StyleXPluginOption { /** * Whether the server compilers keep Rspack's persistent cache. * * Next.js 16 turns on `experiments.cache = { type: 'persistent' }` for * every `next-rspack` compiler. With a `proxy.ts`/`middleware.ts` entry * that cache degrades catastrophically in the server compilers: the build * spends its time in Rspack's native filesystem layer walking the whole * workspace, and warm builds are slower than cold ones (measured on the * example app: 1.6s -> 27s cold, 50s warm; unbounded in large monorepos). * * Left unset, the cache is disabled for the server compilers of a * **production build** when a proxy/middleware entry is detected. `next dev` * is left alone: it shows no such stall, and keeping its cache is worth * ~200ms on the first compile of a route. Set `true` to keep Next.js' * setting untouched, `false` to always disable it (dev included). * * Auto-detection also stands down when your own `webpack()` hook configures * `experiments.cache` itself, so an explicit choice there always wins. * * @default undefined (auto-detect, production builds only) */ rspackServerPersistentCache?: boolean; } declare const withStyleX: (pluginOptions?: StyleXNextRspackPluginOption) => (nextConfig?: NextConfig) => NextConfig; export default withStyleX; //# sourceMappingURL=rspack.d.ts.map