UNPKG

histoire

Version:

A fast story book powered by Vite

19 lines (18 loc) • 687 B
import { closeContext, createContext } from '../context.js'; import { createPreviewHosting as createHosting } from '../runtime/hosting/preview.js'; /** Acquires fresh configuration only; built lookup never scans live story sources. */ export async function previewProject(root, configFile, options) { const context = await createContext({ root, configFile, mode: 'build' }); try { return await createHosting({ ...options, context }); } catch (error) { try { await closeContext(context); } catch (cleanupError) { throw new AggregateError([error, cleanupError], String(error)); } throw error; } }