Skip to content

Commit

Permalink
fix: issues with environment variable not in webpack config for core
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienne-deriv committed Jul 20, 2023
1 parent 1e11c8b commit 2e2652f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/analytics/src/rudderstack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ export class RudderStack {
}

init() {
const is_production = process.env.NODE_ENV === 'production';
const is_staging = process.env.NODE_ENV === 'staging';
const is_production = process.env.CIRCLE_JOB === 'release_production';
const is_staging = process.env.CIRCLE_JOB === 'release_staging';

if (!is_production && !is_staging) return;

Expand Down
3 changes: 3 additions & 0 deletions packages/core/build/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ const plugins = ({ base, is_test_env }) => {
'process.env.DATADOG_SESSION_SAMPLE_RATE': JSON.stringify(process.env.DATADOG_SESSION_SAMPLE_RATE),
'process.env.CIRCLE_TAG': JSON.stringify(process.env.CIRCLE_TAG),
'process.env.CIRCLE_JOB': JSON.stringify(process.env.CIRCLE_JOB),
'process.env.RUDDERSTACK_URL': JSON.stringify(process.env.RUDDERSTACK_URL),
'process.env.RUDDERSTACK_PRODUCTION_KEY': JSON.stringify(process.env.RUDDERSTACK_PRODUCTION_KEY),
'process.env.RUDDERSTACK_STAGING_KEY': JSON.stringify(process.env.RUDDERSTACK_STAGING_KEY),
}),
new CleanWebpackPlugin(),
new CopyPlugin(copyConfig(base)),
Expand Down

0 comments on commit 2e2652f

Please sign in to comment.