next-yak
Version:
next-yak is a CSS-in-JS solution tailored for Next.js that seamlessly combines the expressive power of styled-components syntax with efficient build-time extraction of CSS using Next.js's built-in CSS configuration
30 lines (29 loc) • 1.04 kB
TypeScript
import { YakConfigOptions } from "../withYak/index.js";
import { RsbuildPlugin } from "@rsbuild/core";
//#region rsbuild/index.d.ts
/**
* Rsbuild plugin for next-yak.
*
* Wires the yak-swc transform as an Rspack `pre` loader that runs the
* compile-time CSS extraction in-loader and inlines the result as a
* `data:text/css;base64,` import (the same strategy as the Turbopack loader).
* Running it as a `pre` loader keeps yak-swc out of Rsbuild's own
* `builtin:swc-loader`, so it composes cleanly with that pass (TS/JSX, React
* Fast Refresh, and the React Compiler).
*
* @example
* ```ts
* // rsbuild.config.ts
* import { defineConfig } from "@rsbuild/core";
* import { pluginReact } from "@rsbuild/plugin-react";
* import { pluginYak } from "next-yak/rsbuild";
*
* export default defineConfig({
* plugins: [pluginReact(), pluginYak()],
* });
* ```
*/
declare function pluginYak(yakOptions?: YakConfigOptions): RsbuildPlugin;
//#endregion
export { type YakConfigOptions, pluginYak };
//# sourceMappingURL=index.d.ts.map