@yinxulai/babel-plugin-less
Version:
一个 `Babel` 插件,用来帮助你对文件中引用的 `less` 进行预处理、转换成 `css` 并自动管理, 支持 `cssModule`, `autoPrefix`
28 lines • 847 B
TypeScript
/// <reference types="less" />
import { PluginObj } from '@babel/core';
declare type GenerateScopedNameFunction = (name: string, filename: string, css: string) => string;
export interface Options {
autoPrefix?: boolean;
cssModule?: CssModuleOptions | boolean;
lessOptions?: Less.Options;
}
export interface CssModuleOptions {
scopeBehaviour?: 'global' | 'local';
globalModulePaths?: (RegExp | string)[];
generateScopedName?: string | GenerateScopedNameFunction;
hashPrefix?: string;
camelCase?: boolean;
root?: string;
}
export interface TransformStyleResult {
css?: string;
tokens?: {
[key: string]: string;
};
}
export interface TransformStyleOptions extends Options {
fileName: string;
}
declare function plugin(): PluginObj;
export default plugin;
//# sourceMappingURL=index.d.ts.map