Skip to content

Commit

Permalink
fix(astro compiler): check vite command to decide on "annotateSourceF…
Browse files Browse the repository at this point in the history
…ile" (#9275)

* prevent annotations in build

* add changeset

* Apply suggestions from code review

Co-authored-by: Bjorn Lu <[email protected]>

---------

Co-authored-by: Bjorn Lu <[email protected]>
  • Loading branch information
lilnasy and bluwy authored Dec 4, 2023
1 parent 5d566cf commit 0968cb1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/chatty-poems-doubt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fixes an issue where html annotations relevant only to the dev server were included in the production build.
2 changes: 1 addition & 1 deletion packages/astro/src/core/compile/compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0968cb1

Please sign in to comment.