diff options
author | 2021-07-12 15:25:14 +0200 | |
---|---|---|
committer | 2021-07-12 09:25:14 -0400 | |
commit | 1b73f95806884b43db27f997c1b8ee520633d7e3 (patch) | |
tree | 55a5fb1f4b77ee9d5d493f0201561d70568775cd | |
parent | c48acb3d84ef8b3cca1fdfa1ae5d66f6ebd1a918 (diff) | |
download | astro-1b73f95806884b43db27f997c1b8ee520633d7e3.tar.gz astro-1b73f95806884b43db27f997c1b8ee520633d7e3.tar.zst astro-1b73f95806884b43db27f997c1b8ee520633d7e3.zip |
Only display notice if needed (#659)
-rw-r--r-- | .changeset/pink-buttons-destroy.md | 5 | ||||
-rw-r--r-- | packages/astro/src/build.ts | 4 |
2 files changed, 8 insertions, 1 deletions
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 }); |