UNPKG

histoire

Version:

A fast story book powered by Vite

16 lines (15 loc) • 505 B
import pc from 'picocolors'; import { createContext } from '../context.js'; import { startPreview } from '../preview.js'; export async function previewCommand(options) { const ctx = await createContext({ mode: 'build', }); for (const plugin of ctx.config.plugins) { if (plugin.onPreview) { await plugin.onPreview(); } } const { baseUrl } = await startPreview(options.port, ctx); console.log(`Preview server listening on ${pc.cyan(baseUrl)}`); }