@vant/cli
Version:
Vant CLI is a tool for building vue component library. You can quickly build a full-featured Vue component library with vant-cli.
13 lines (12 loc) • 388 B
JavaScript
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) {
const source = readFileSync(filePath, 'utf-8');
const { css } = await less.render(source, {
filename: filePath,
paths: [join(CWD, 'node_modules')],
});
return css;
}