chore(cli): split compilers

This commit is contained in:
陈嘉涵
2019-11-29 13:20:43 +08:00
parent e2c9628316
commit 51d2512311
9 changed files with 90 additions and 74 deletions
@@ -0,0 +1,11 @@
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;
}