#!/usr/bin/env -S node -r esbin import fs from "fs" import React from "react" import { renderToStaticMarkup } from "react-dom/server" const __DEV__ = process.env.NODE_ENV !== "production" const Head: FC<{ children: React.ReactNode }> = ({ children }) => (
{children} ) const files: { [path: string]: React.ReactElement } = { "./dist/background.html": ( ), "./dist/devtools.html": ( ), "./dist/options.html": ( {__DEV__ && ( // React DevTools // curl -s http://localhost:8097 | openssl dgst -sha384 -binary | openssl base64 -A )} ), "./dist/playground.html": ( ), "./dist/popup.html": ( ), "./dist/reference.html": ( ), } for (const [path, content] of Object.entries(files)) { const html = "" + renderToStaticMarkup(content) fs.writeFileSync(path, html) }