UNPKG

@visulima/packem

Version:

A fast and modern bundler for Node.js and TypeScript.

37 lines (35 loc) 1.44 kB
import type { Plugin } from "postcss"; import type Processor from "postcss/lib/processor"; import type { AutoModules } from "../../../types.d.cts"; /** Options for [CSS Modules](https://github.com/css-modules/css-modules) */ export interface ModulesOptions { /** Export global classes */ exportGlobals?: boolean; /** Fail on wrong order of composition */ failOnWrongOrder?: boolean; /** * Placeholder or function for scoped name generation. * Allowed blocks for placeholder: * - `[dir]`: The directory name of the asset. * - `[name]`: The file name of the asset excluding any extension. * - `[local]`: The original value of the selector. * - `[hash(:<num>)]`: A hash based on the name and content of the asset (with optional length). * @default "[name]_[local]__[hash:8]" */ generateScopedName?: string | ((name: string, file: string, css: string) => string); /** * Files to include for [CSS Modules](https://github.com/css-modules/css-modules) * for files named `[name].module.[ext]` * (e.g. `foo.module.css`, `bar.module.stylus`), * or pass your own function or regular expression * @default false */ include?: AutoModules; /** * Default mode for classes * @default "local" */ mode?: "global" | "local" | "pure"; } declare const _default: (options: ModulesOptions) => (Plugin | Processor)[]; export = _default;