feat(cli): using rslog (#12334)

This commit is contained in:
neverland
2023-10-02 21:34:03 +08:00
committed by GitHub
parent 53188a7093
commit 087ecda7b2
15 changed files with 48 additions and 60 deletions
@@ -45,7 +45,7 @@ export async function compileSite(production = false) {
const require = createRequire(import.meta.url);
const { version } = require('vite/package.json');
const viteInfo = color.cyan(`vite v${version}`);
console.log(`\n ${viteInfo}` + color.green(` dev server running at:\n`));
console.log(` ${viteInfo}` + color.green(` dev server running at:\n`));
server.printUrls();
}
}
@@ -1,10 +1,10 @@
import { parse } from 'node:path';
import fse from 'fs-extra';
import { logger } from 'rslog';
import { getVantConfig, replaceExt } from '../common/index.js';
import { compileCss } from './compile-css.js';
import { compileLess } from './compile-less.js';
import { compileSass } from './compile-sass.js';
import { consola } from '../common/logger.js';
const { readFileSync, writeFileSync, removeSync } = fse;
@@ -25,7 +25,7 @@ async function compileFile(filePath: string) {
const source = readFileSync(filePath, 'utf-8');
return await compileCss(source);
} catch (err) {
consola.error('Compile style failed: ' + filePath);
logger.error('Compile style failed: ' + filePath);
throw err;
}
}