Merge pull request #4228 from balena-io/aethernet-patch-2

patch: fix sentry DSN
This commit is contained in:
flowzone-app[bot] 2024-05-22 13:27:17 +00:00 committed by GitHub
commit 74854f1720
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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,
@ -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: {
@ -109,4 +108,5 @@ export const mainConfig: Configuration = {
resolve: {
extensions: ['.js', '.ts', '.jsx', '.tsx', '.css', '.json'],
},
plugins: [injectAnalyticsToken],
};