import { readFileSync, writeFileSync, rmSync } from 'fs' import { resolve, dirname } from 'path' import { fileURLToPath } from 'url' const __dirname = dirname(fileURLToPath(import.meta.url)) const root = resolve(__dirname, '..') // Import SSR bundle built by vite build --ssr const { render } = await import('../dist/server/entry-server.js') const template = readFileSync(resolve(root, 'dist/index.html'), 'utf-8') const appHtml = render() const html = template.replace('
', `