Skip to content

Commit

Permalink
Reduce prerender dynamic value warning false positives (#11745)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy authored Aug 16, 2024
1 parent 50c3ed2 commit 89bab1e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/new-pillows-kick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Prints prerender dynamic value usage warning only if it's used
2 changes: 1 addition & 1 deletion packages/astro/src/vite-plugin-env/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ export default function envVitePlugin({ settings, logger }: EnvPluginOptions): v
// TODO: Remove in Astro 5
let exportConstPrerenderStr: string | undefined;
s.replace(exportConstPrerenderRe, (m, key) => {
exportConstPrerenderStr = m;
if (privateEnv[key] != null) {
exportConstPrerenderStr = m;
return `export const prerender = ${privateEnv[key]}`;
} else {
return m;
Expand Down

0 comments on commit 89bab1e

Please sign in to comment.