From 6ec7d61d9e7bb65933f6a80ef34f9cb75b205ccb Mon Sep 17 00:00:00 2001 From: Anand Chowdhary Date: Fri, 22 Jan 2021 20:21:22 +0530 Subject: [PATCH] :sparkles: Add support for robots.txt --- post-process.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/post-process.ts b/post-process.ts index 7c69a0e..6af9272 100644 --- a/post-process.ts +++ b/post-process.ts @@ -7,6 +7,7 @@ export const postProcess = async () => { let config: { "status-website"?: { cname?: string; + robotsText?: string; baseUrl?: string; }; } = load(await readFile(join("..", ".upptimerc.yml"), "utf8")) as any; @@ -23,6 +24,13 @@ export const postProcess = async () => { if (config["status-website"] && config["status-website"].cname) await writeFile(join(".", "__sapper__", "export", "CNAME"), config["status-website"].cname); + + if (config["status-website"] && config["status-website"].robotsText) + await writeFile( + join(".", "__sapper__", "export", "robots.txt"), + config["status-website"].robotsText + ); + await copyFile( join(".", "__sapper__", "export", "service-worker-index.html"), join(".", "__sapper__", "export", "404.html")