diff --git a/packages/cli/utils/loadEnvVariables.js b/packages/cli/utils/loadEnvVariables.js index 3dd47c439ce..2ef3486756a 100644 --- a/packages/cli/utils/loadEnvVariables.js +++ b/packages/cli/utils/loadEnvVariables.js @@ -48,6 +48,7 @@ if (project.config.featureFlags) { // With 5.38.0, we are hiding the `WEBINY_ELASTICSEARCH_INDEX_LOCALE` env variable and always setting it to `true`. // This is because this variable is not something users should be concerned with, nor should they be able to change it. // In order to ensure backwards compatibility, we first check if the variable is set, and if it is, we don't override it. -if (!"WEBINY_ELASTICSEARCH_INDEX_LOCALE" in process.env) { +const esIndexLocaleEnvVarExists = "WEBINY_ELASTICSEARCH_INDEX_LOCALE" in process.env; +if (!esIndexLocaleEnvVarExists) { process.env.WEBINY_ELASTICSEARCH_INDEX_LOCALE = "true"; }