Kennzeichne die Entwicklungsumgebung in der Oberflaeche, damit sie sich von Produktion unterscheiden laesst.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
db4063296b
commit
cbd45a8997
8 files changed
+106
-21
No files matched your search
@@ -0,0 +1,20 @@
|
||||
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);
|
||||
Reference in new issue
Block a user