Make @netlify/config
return site environment variables in local builds
#2036
Labels
type: feature
code contributing to the implementation of a feature and/or user facing functionality
Site environment variables come from different sources: the site, the team, and addons.
Those environment variables are used by several parts of the build: the build command and plugins, but those are also used as the default value of
@netlify/build
options and@netlify/config
options. Those are also used by CLI commands.At the moment,
@netlify/config
does not compute/merge/return environment variables.@netlify/build
does takebuild.environment
fromnetlify.toml
into account, but not site/team/addons ones.@netlify/config
should compute/merge environment variables from the site, team and addons, then return it as anenv
object. This should not happen ifmode
isbuildbot
. Thisenv
object should then be used by:@netlify/build
. We should make sure it is currently merged in the current logic. For example, it should not be possible to override readonly environment variables likeCONTEXT
(see existing logic).In order to compute those, some additional API calls will need to be performed by
@netlify/config
, in addition togetSite
which is already currently performed in local builds.@erezrokah
The text was updated successfully, but these errors were encountered: