/
githubmirror
/
solid
Обзор
Документация
Войти
/
githubmirror
/
solid
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
packages/solid-ssr/static/index.js
26 строк
719 B
花果山大圣
add prettier code format in git-commit-hook (#1769)
27 июн 2023, 02:07
Не верифицирован
27 июн 2023, 02:07
e660e5a
Код
Авторство
О чём код?
import { resolve } from "path"; import { fileURLToPath } from "url"; import { execFile } from "child_process"; import { promisify } from "util"; const exec = promisify(execFile); const __dirname = fileURLToPath(new URL(".", import.meta.url)); const pathToRunner = resolve(__dirname, "writeToDisk.js"); async function run({ entry, output, url }) { const { stdout, stderr } = await exec("node", [ pathToRunner, entry, output, url, "--trace-warnings" ]); if (stdout.length) console.log(stdout); if (stderr.length) console.log(stderr); } export default async function renderStatic(config) { if (Array.isArray(config)) { await Promise.all(config.map(run)); } else await run(config); }