21 lines
880 B
JavaScript
21 lines
880 B
JavaScript
import fs from "node:fs";
|
|
|
|
if (process.env.VITE_TSUMUGU_ENV !== "development") {
|
|
process.exit(0);
|
|
}
|
|
|
|
const manifestPath = new URL("./dist/manifest.webmanifest", import.meta.url);
|
|
const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
|
|
manifest.name = "Tsumugu Entwicklung";
|
|
manifest.short_name = "Tsumugu Dev";
|
|
manifest.theme_color = "#8a5a12";
|
|
fs.writeFileSync(manifestPath, `${JSON.stringify(manifest, null, 2)}\n`);
|
|
|
|
const indexPath = new URL("./dist/index.html", import.meta.url);
|
|
const html = fs
|
|
.readFileSync(indexPath, "utf8")
|
|
.replace("<title>Tsumugu</title>", "<title>Tsumugu · Entwicklung</title>")
|
|
.replace('name="apple-mobile-web-app-title" content="Tsumugu"', 'name="apple-mobile-web-app-title" content="Tsumugu Dev"')
|
|
.replace('name="theme-color" content="#085041"', 'name="theme-color" content="#8a5a12"');
|
|
fs.writeFileSync(indexPath, html);
|