mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-05-22 22:49:15 +08:00
15 lines
382 B
TypeScript
15 lines
382 B
TypeScript
import less from 'less';
|
|
import { join } from 'node:path';
|
|
import { readFileSync } from 'node:fs';
|
|
import { CWD } from '../common/constant.js';
|
|
|
|
export async function compileLess(filePath: string) {
|
|
const source = readFileSync(filePath, 'utf-8');
|
|
const { css } = await less.render(source, {
|
|
filename: filePath,
|
|
paths: [join(CWD, 'node_modules')],
|
|
});
|
|
|
|
return css;
|
|
}
|