Skip to content

Commit

Permalink
fix: #12777 unocss 开发模式下,等待unocss进程启动
Browse files Browse the repository at this point in the history
  • Loading branch information
AdoKevin committed Nov 13, 2024
1 parent 95ed9f7 commit 4169903
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/plugins/src/unocss.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,19 @@ export default (api: IApi) => {
cwd: api.cwd,
stdio: isDev ? 'pipe' : 'inherit',
});
if (!isDev) {

if (isDev) {
await new Promise<void>((resolve) => {
const { stdout } = execaRes;
function dataHandler() {
resolve();
stdout?.off('data', dataHandler);
}
stdout?.on('data', dataHandler);
});

api.logger.info('unocss watch mode is running!');
} else {
await execaRes;
}
});
Expand Down

0 comments on commit 4169903

Please sign in to comment.