Package APIs

@master/css-next

Next.js integration for Master CSS

Public entrypoints

Connect Master CSS to Next.js configuration and build output. The root export wraps Next configuration; the adapter entry supports build integration and adapter composition.

Declarations show the public surface of each import path. Referenced type names may be local to the package; import only names listed as exports here. Private implementation is omitted, while constructor restrictions remain visible.

@master/css-next

Next configuration wrapper and integration options.

default

Default export of withMasterCSS.

TypeScript
export { withMasterCSS as default };

MasterCSSNextOptions

TypeScript
export interface MasterCSSNextOptions {    enabled?: boolean;    mode?: MasterCSSRenderingMode;    pruneNativeCSS?: boolean;    runtime?: boolean | MasterCSSIntegrationRuntimeOptions;    scanner?: MasterCSSScannerConfiguration;    /**     * Write a build report with rendered files.     * `true` writes `.next/master-css-build-report.json`; a string is resolved from `distDir`.     */    buildReport?: boolean | string;    /**     * Log rendered output details during `next build`.     */    debug?: boolean;    /**     * Adapter execution order when composing with another Next adapter.     */    adapterOrder?: MasterCSSNextAdapterOrder;}

withMasterCSS

TypeScript
export declare function withMasterCSS<T extends NextConfig>(  nextConfig: T,  options: MasterCSSNextOptions & ({    enabled: false;} | {    mode: 'runtime';})): T;export declare function withMasterCSS<T extends NextConfig>(  nextConfig: T,  options: MasterCSSNextOptions & {    mode: 'progressive' | 'pre-render';}): WithAdapterPath<T>;export declare function withMasterCSS<T extends NextConfig>(  nextConfig: T,  options: MasterCSSNextOptions & {    mode: 'static';}): Promise<T>;export declare function withMasterCSS<T extends NextConfig>(  nextConfig?: T,  options?: MasterCSSNextOptions & {    mode?: 'static';}): Promise<T>;export declare function withMasterCSS<T extends NextConfig>(  nextConfig?: T,  options?: MasterCSSNextOptions): T | WithAdapterPath<T> | Promise<T>;

@master/css-next/adapter

Build adapter, composition helpers and rendered-output reports.

BuildReport

TypeScript
export interface BuildReport {    version: 1;    nextVersion: string;    buildId: string;    files: RenderedOutput[];}

ComposedAdapterOptions

TypeScript
export interface ComposedAdapterOptions {    order?: MasterCSSNextAdapterOrder;}

createAdapter

TypeScript
export declare function createAdapter(options?: MasterCSSNextOptions): NextAdapter;

createComposedAdapter

TypeScript
export declare function createComposedAdapter(  masterAdapter: NextAdapter,  externalAdapter: AdapterLoader,  { order }?: ComposedAdapterOptions): NextAdapter;

default

TypeScript
declare const _default: NextAdapter;export { _default as default };

RenderedOutput

TypeScript
export interface RenderedOutput {    file: string;    pathname: string;    source: HTMLBuildOutput['source'];    classes: string[];    cssBytes: number;    hydrationManifestBytes: number;    hydrationManifestFile?: string;    rendered: boolean;}

renderNextBuildOutputs

TypeScript
export declare function renderNextBuildOutputs(  ctx: BuildCompleteContext,  rawOptions?: MasterCSSNextOptions): Promise<RenderedOutput[]>;

Using this contract

Use the root default export in Next configuration. Its overloads distinguish synchronous runtime or disabled configuration from asynchronous static configuration. See Next.js installation for the setup and supported rendering modes.


© 2026 Aoyue Design LLC.MIT License
Trademark Policy