feat(cli): improve build watch mode logger

This commit is contained in:
陈嘉涵 2019-12-24 08:13:48 +08:00
parent ec1c87f8ae
commit eafcc128a2
3 changed files with 7 additions and 2 deletions

View File

@ -173,6 +173,8 @@ async function buildPackageEntry() {
}
function watchFileChange() {
logger.watch('Compiled successfully, watching file changes...');
chokidar.watch(SRC_DIR).on('change', async path => {
const logger = getInteractiveLogger();
const esPath = path.replace(SRC_DIR, ES_DIR);

View File

@ -24,7 +24,10 @@ export function getStepper(totalStep: number) {
export function getInteractiveLogger() {
const interactive = new logger.Signale({
interactive: true
interactive: true,
config: {
displayTimestamp: true
}
});
return interactive;

View File

@ -18,7 +18,7 @@ command('lint').action(lint);
command('clean').action(clean);
command('build')
.option('--watch', 'Watch file watch')
.option('--watch', 'Watch file change')
.action(build);
command('release').action(release);