From 1b73f95806884b43db27f997c1b8ee520633d7e3 Mon Sep 17 00:00:00 2001 From: Johan Stenehall Date: Mon, 12 Jul 2021 15:25:14 +0200 Subject: [PATCH] Only display notice if needed (#659) --- .changeset/pink-buttons-destroy.md | 5 +++++ packages/astro/src/build.ts | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/pink-buttons-destroy.md diff --git a/.changeset/pink-buttons-destroy.md b/.changeset/pink-buttons-destroy.md new file mode 100644 index 000000000..f5291b456 --- /dev/null +++ b/.changeset/pink-buttons-destroy.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Only show the buildOptions.site notice if not already set diff --git a/packages/astro/src/build.ts b/packages/astro/src/build.ts index 073dbd2c3..c5aac23c7 100644 --- a/packages/astro/src/build.ts +++ b/packages/astro/src/build.ts @@ -53,7 +53,9 @@ export async function build(astroConfig: AstroConfig, logging: LogOptions = defa }; // warn users if missing config item in build that may result in broken SEO (can’t disable, as they should provide this) - warn(logging, 'config', `Set "buildOptions.site" to generate correct canonical URLs and sitemap`); + if (!astroConfig.buildOptions.site) { + warn(logging, 'config', `Set "buildOptions.site" to generate correct canonical URLs and sitemap`); + } const mode: RuntimeMode = 'production'; const runtime = await createRuntime(astroConfig, { mode, logging: runtimeLogging });