histoire
Version:
A fast story book powered by Vite
16 lines (15 loc) • 720 B
JavaScript
import { fileURLToPath } from 'node:url';
import { build } from '../build/index.js';
import { createContext } from '../context.js';
import { exitAfterFlush } from '../util/exit.js';
export async function buildCommand(options) {
const ctx = await createContext({
configFile: options.config,
mode: 'build',
});
await build(ctx, { target: options.target, nodeEntryFile: fileURLToPath(new URL('../deploy/entry.js', import.meta.url)) });
// Same safety net as `histoire test`: browser story collection can leave a
// Playwright browser or a Vite server behind when its teardown times out,
// which would hang the CLI in CI long after the build succeeded.
await exitAfterFlush();
}