mirror of
https://github.com/youzan/vant.git
synced 2026-03-30 02:00:43 +08:00
12 lines
282 B
TypeScript
12 lines
282 B
TypeScript
import { readFileSync } from 'fs-extra';
|
|
import { render as renderLess } from 'less';
|
|
|
|
export async function compileLess(filePath: string) {
|
|
const source = readFileSync(filePath, 'utf-8');
|
|
const { css } = await renderLess(source, {
|
|
filename: filePath
|
|
});
|
|
|
|
return css;
|
|
}
|