mirror of
https://github.com/kemko/blogfeeds.net.git
synced 2026-01-01 16:05:41 +03:00
feat: init
This commit is contained in:
18
scripts/build-site.ts
Normal file
18
scripts/build-site.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { $ } from "bun";
|
||||
|
||||
// Clean up dist
|
||||
await $`rm -rf site-dist`;
|
||||
// Create new dist
|
||||
await $`cp -r site site-dist`;
|
||||
// Compile tailwindcss
|
||||
await $`bunx @tailwindcss/cli -i ./site/input.css -o ./site-dist/output.css `;
|
||||
// Read index file
|
||||
const htmlContent = await Bun.file("site-dist/index.html").text();
|
||||
// Update script tags and css link
|
||||
const updatedHtml = htmlContent
|
||||
.replace(
|
||||
`<link rel="stylesheet" href="tailwindcss" />`,
|
||||
`<link rel="stylesheet" href="output.css" />`,
|
||||
);
|
||||
// Write file
|
||||
await Bun.write("site-dist/index.html", updatedHtml);
|
||||
Reference in New Issue
Block a user