1.0.1 • Published 4 years ago
netlify-plugin-replace-env v1.0.1
netlify-plugin-replace-env
This plugin replaces ENV vars interpolations inside other ENV vars.
So if you have an ENV var like MY_VAR=$MY_OTHER_VAR/foo, this plugin is going to replace
the value of MY_VAR by substituing MY_OTHER_VAR value.
MY_OTHER_VAR=bar
MY_VAR=$MY_OTHER_VAR/foo
# After the plugin execution
MY_OTHER_VAR=bar
MY_VAR=bar/fooEnabling the plugin
This plugin is disabled by default for all Netlify deploy contexts.
To enbable it for all deploy contexts, set the env var ENABLE_NETLIFY_PLUGIN_DYNAMIC_REPLACE_ENV to true (must be that value).
To enbalbe for a scpecific deploy context, suffix the above env with the uppercase context name:
ENABLE_NETLIFY_PLUGIN_DYNAMIC_REPLACE_ENV_PRODUCTION=trueenable for production only deploy context.ENABLE_NETLIFY_PLUGIN_DYNAMIC_REPLACE_ENV_DEPLOY_PREVIEW=trueenable for deploy-preview only deploy context.ENABLE_NETLIFY_PLUGIN_DYNAMIC_REPLACE_ENV_BRANCH_DEPLOY=trueenable for branch-deploy only deploy context.
Usage
Add the plugin
Add a [[plugins]] entry to your netlify.toml file:
[[plugins]]
package = 'netlify-plugin-replace-env'