Skip to content

Commit

Permalink
Merge pull request #4228 from balena-io/aethernet-patch-2
Browse files Browse the repository at this point in the history
patch: fix sentry DSN
  • Loading branch information
flowzone-app[bot] authored May 22, 2024
2 parents 62ac0b9 + 4ffda6e commit 74854f1
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ const rules: Required<ModuleOptions>['rules'] = [
},
];

const injectAnalyticsToken = new DefinePlugin({
'process.env.SENTRY_TOKEN': JSON.stringify(process.env.SENTRY_TOKEN || ''),
'process.env.AMPLITUDE_TOKEN': JSON.stringify(
process.env.AMPLITUDE_TOKEN || '',
),
});

export const rendererConfig: Configuration = {
module: {
rules,
Expand All @@ -79,15 +86,7 @@ export const rendererConfig: Configuration = {
banner: '__REACT_DEVTOOLS_GLOBAL_HOOK__ = { isDisabled: true };',
raw: true,
}),
// Inject the analytics key into the code
new DefinePlugin({
'process.env.SENTRY_TOKEN': JSON.stringify(
process.env.SENTRY_TOKEN || '',
),
'process.env.AMPLITUDE_TOKEN': JSON.stringify(
process.env.AMPLITUDE_TOKEN || '',
),
}),
injectAnalyticsToken,
],

resolve: {
Expand All @@ -109,4 +108,5 @@ export const mainConfig: Configuration = {
resolve: {
extensions: ['.js', '.ts', '.jsx', '.tsx', '.css', '.json'],
},
plugins: [injectAnalyticsToken],
};

0 comments on commit 74854f1

Please sign in to comment.