ttrpg-tools/src/cli/commands/serve.ts

15 lines
478 B
TypeScript
Raw Normal View History

2026-02-26 00:17:23 +08:00
import type { CommandHandler } from '../types.js';
export const serveCommand: CommandHandler = async (dir, options) => {
console.log(`启动开发服务器...`);
console.log(`目录:${dir}`);
console.log(`端口:${options.port}`);
// TODO: 实现开发服务器逻辑
// 1. 扫描目录下的所有 .md 文件
// 2. 启动 rsbuild 开发服务器
// 3. 监听文件变化
console.log('开发服务器已启动http://localhost:' + options.port);
};