0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-06 22:10:10 -05:00

Reduce prerender dynamic value warning false positives (#11745)

This commit is contained in:
Bjorn Lu 2024-08-16 23:03:27 +08:00 committed by GitHub
parent 50c3ed238d
commit 89bab1e707
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Prints prerender dynamic value usage warning only if it's used

View file

@ -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;