Optional
envWhen specified includes environment variables from dotenv files (.env
), in the same way the studio does.
A mode
must be specified, usually development
or production
, which will load the corresponding .env.development
or .env.production
.
To specify where to look for the dotenv files, specify options.envFile.envDir
.
Optional
jsonWhen specified, JSON-encodes the values, which is handy if you want to pass
this to a bundlers hardcoded defines, such as Vite's define
or Webpack's DefinePlugin
.
Optional
prefixWhen specified adds a prefix to the environment variable keys,
eg: getStudioEnvironmentVariables({prefix: 'process.env.'})
The params for the
getStudioEnvironmentVariables
function that gets Studio focused environment variables.