From c130a7ae6c13674f90a122a3b59c9d96e5737da7 Mon Sep 17 00:00:00 2001 From: Brad Decker Date: Thu, 29 Oct 2020 09:31:04 -0500 Subject: [PATCH] prevent environment key from leaking into all builds (#9752) --- development/build/scripts.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/development/build/scripts.js b/development/build/scripts.js index c6b9734d5..1f4d17881 100644 --- a/development/build/scripts.js +++ b/development/build/scripts.js @@ -325,7 +325,8 @@ function createScriptTasks ({ browserPlatforms, livereload }) { // inflating event volume. const SEGMENT_PROD_WRITE_KEY = opts.testing ? undefined : process.env.SEGMENT_PROD_WRITE_KEY const SEGMENT_DEV_WRITE_KEY = opts.testing ? undefined : conf.SEGMENT_WRITE_KEY - const SEGMENT_LEGACY_WRITE_KEY = opts.testing ? undefined : conf.SEGMENT_LEGACY_WRITE_KEY + const SEGMENT_PROD_LEGACY_WRITE_KEY = opts.testing ? undefined : process.env.SEGMENT_PROD_LEGACY_WRITE_KEY + const SEGMENT_DEV_LEGACY_WRITE_KEY = opts.testing ? undefined : conf.SEGMENT_LEGACY_WRITE_KEY // Inject variables into bundle bundler.transform(envify({ @@ -345,7 +346,7 @@ function createScriptTasks ({ browserPlatforms, livereload }) { : conf.INFURA_PROJECT_ID ), SEGMENT_WRITE_KEY: environment === 'production' ? SEGMENT_PROD_WRITE_KEY : SEGMENT_DEV_WRITE_KEY, - SEGMENT_LEGACY_WRITE_KEY: environment === 'production' ? process.env.SEGMENT_LEGACY_WRITE_KEY : SEGMENT_LEGACY_WRITE_KEY, + SEGMENT_LEGACY_WRITE_KEY: environment === 'production' ? SEGMENT_PROD_LEGACY_WRITE_KEY : SEGMENT_DEV_LEGACY_WRITE_KEY, }), { global: true, })