// A throwaway client build for the vhost tests (#66). The real Vite build lands in T4; until then the // test nginx's `/` needs *some* `dist` to serve, with the shape DESIGN 11.1 pins: an index.html that // names a content-hashed asset under /assets/. Nothing here is committed: the fixture is written into // the run's state dir, and no version of it pretends to be the client. import fs from 'node:fs' import path from 'node:path' export const ASSET_HASH = 'a1b2c3d4e5f6' export function writeClientDist(dir, { hash = ASSET_HASH } = {}) { const assetPath = `/assets/app-${hash}.js` fs.mkdirSync(path.join(dir, 'assets'), { recursive: true }) const index = `
client dist fixture
` const asset = `// content-hashed fixture asset (#66)\ndocument.documentElement.dataset.fixture = 'loaded'\n` fs.writeFileSync(path.join(dir, 'index.html'), index) fs.writeFileSync(path.join(dir, assetPath.slice(1)), asset) return { dir, indexHtml: index, assetPath } }