refactor(@vant/cli): migrate to ESM package

This commit is contained in:
chenjiahan
2021-10-28 20:09:00 +08:00
committed by neverland
parent eec2ac4c0f
commit 1b45f38133
50 changed files with 255 additions and 196 deletions
@@ -1,11 +1,11 @@
import less from 'less';
import { join } from 'path';
import { render } from 'less';
import { readFileSync } from 'fs-extra';
import { CWD } from '../common/constant';
import { readFileSync } from 'fs';
import { CWD } from '../common/constant.js';
export async function compileLess(filePath: string) {
const source = readFileSync(filePath, 'utf-8');
const { css } = await render(source, {
const { css } = await less.render(source, {
filename: filePath,
paths: [join(CWD, 'node_modules')],
});