summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.changeset/chatty-poems-doubt.md5
-rw-r--r--packages/astro/src/core/compile/compile.ts2
2 files changed, 6 insertions, 1 deletions
diff --git a/.changeset/chatty-poems-doubt.md b/.changeset/chatty-poems-doubt.md
new file mode 100644
index 000000000..32bc05c9d
--- /dev/null
+++ b/.changeset/chatty-poems-doubt.md
@@ -0,0 +1,5 @@
+---
+'astro': patch
+---
+
+Fixes an issue where html annotations relevant only to the dev server were included in the production build.
diff --git a/packages/astro/src/core/compile/compile.ts b/packages/astro/src/core/compile/compile.ts
index 8a187e652..2877d6a3e 100644
--- a/packages/astro/src/core/compile/compile.ts
+++ b/packages/astro/src/core/compile/compile.ts
@@ -48,7 +48,7 @@ export async function compile({
resultScopedSlot: true,
transitionsAnimationURL: 'astro/components/viewtransitions.css',
annotateSourceFile:
- !viteConfig.isProduction && astroConfig.devToolbar && astroConfig.devToolbar.enabled,
+ viteConfig.command === "serve" && astroConfig.devToolbar && astroConfig.devToolbar.enabled,
preprocessStyle: createStylePreprocessor({
filename,
viteConfig,