stylex-webpack
Version:
The another Webpack Plugin for Facebook's StyleX
42 lines (38 loc) • 1.13 kB
TypeScript
import { NextConfig } from 'next/dist/server/config-shared';
import { Options } from '@stylexjs/babel-plugin';
type CSSTransformer = (css: string) => string | Buffer | Promise<string | Buffer>;
interface StyleXPluginOption {
/**
* stylex options passed to stylex babel plugin
*
* @see https://stylexjs.com/docs/api/configuration/babel-plugin/
*/
stylexOption?: Partial<Options>;
/**
* Specify where stylex will be imported from
*
* @default ['stylex', '@stylexjs/stylex']
*/
stylexImports?: string[];
/**
* Whether to use CSS layers
*
* @default false
*/
useCSSLayers?: boolean;
/**
* Next.js Mode
*
* @default false
*/
nextjsMode?: boolean;
/**
* Enable other CSS transformation
*
* Since stylex-webpack only inject CSS after all loaders, you can not use postcss-loader.
* With this you can incovate `postcss()` here.
*/
transformCss?: CSSTransformer;
}
declare const withStyleX: (pluginOptions?: StyleXPluginOption) => (nextConfig?: NextConfig) => NextConfig;
export { withStyleX };