Question
Netlify Build Plugins ↔ Deploy Previews: Environment Variable Propagation
Rey Indigo
0 reputation · 18 Jul 2024, 12:06 UTC
136.7K views0
Goal
Determine whether environment variables set or modified by Netlify Build Plugins are available in the runtime environment of Deploy Previews, and identify any performance bottlenecks introduced by plugin execution.
Constraints & Uncertainty
- Plugin execution is sequential; only the build phase logs provide exact timing.
- Deploy Previews inherit environment variables from the Netlify UI and project settings, but the precedence of plugin‑generated variables is undocumented.
- Cached plugin outputs may or may not persist across separate Deploy Preview builds.
Specific Questions
- When a plugin sets or alters an environment variable during the build, does that variable appear in the Deploy Preview’s runtime environment?
- If the variable is present, does the value reflect the plugin’s output from the build that generated the preview, or is it overridden by preview‑specific settings?
- Does enabling the plugin’s cache key cause the cached value to be reused in subsequent Deploy Preview builds, and if so, how does that affect variable propagation?