import fs from "fs"; const isProd = process.env.NODE_ENV === "production"; const template = async function ({ vite, url }, name, title = "", props = {}) { const ogTags = []; const ogMeta = props.ogMeta ?? {}; Object.entries(ogMeta).forEach(([key, value]) => { if (!value) return; ogTags.push(``); }); const ogMetaTags = ogTags.join("\n"); // ---------------- // PROD // ---------------- if (isProd) { const ssrModule = await import(`../build/entry-server-${name}/bundle.js`); return `
${ogMetaTags}