prevent environment key from leaking into all builds (#9752)

feature/default_network_editable
Brad Decker 4 years ago committed by GitHub
parent 186ee97d36
commit c130a7ae6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      development/build/scripts.js

@ -325,7 +325,8 @@ function createScriptTasks ({ browserPlatforms, livereload }) {
// inflating event volume. // inflating event volume.
const SEGMENT_PROD_WRITE_KEY = opts.testing ? undefined : process.env.SEGMENT_PROD_WRITE_KEY 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_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 // Inject variables into bundle
bundler.transform(envify({ bundler.transform(envify({
@ -345,7 +346,7 @@ function createScriptTasks ({ browserPlatforms, livereload }) {
: conf.INFURA_PROJECT_ID : conf.INFURA_PROJECT_ID
), ),
SEGMENT_WRITE_KEY: environment === 'production' ? SEGMENT_PROD_WRITE_KEY : SEGMENT_DEV_WRITE_KEY, 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, global: true,
}) })

Loading…
Cancel
Save