Avoid adding imports with a hash in chunks, as this causes long term caching issues.

pull/2827/head
Jérémy Rialland 2023-09-27 15:26:34 -02:00 committed by Jérémy Rialland
parent f8cf7c2b69
commit f9ca30c03c
3 changed files with 8 additions and 0 deletions

View File

@ -22,6 +22,7 @@ if (BRANCH_NAME && IS_STAGING) {
if (!import.meta.env.SSR && (IS_PRODUCTION || IS_STAGING)) {
init({
release: SENTRY_RELEASE_NAME,
dsn: 'https://d857393f4cfb40eebc0b9b54893bab23@sentry.incubateur.net/9',
integrations: [
new CaptureConsole({ levels: ['error'] }),

View File

@ -52,3 +52,8 @@ declare const IS_STAGING: boolean
* This variable is statically replaced during the build
*/
declare const IS_DEVELOPMENT: boolean
/**
* This variable is statically replaced during the build
*/
declare const SENTRY_RELEASE_NAME: string

View File

@ -55,6 +55,7 @@ export default defineConfig(({ command, mode }) => ({
IS_DEVELOPMENT: mode === 'development',
IS_STAGING: mode === 'production' && !isProductionBranch(mode),
IS_PRODUCTION: mode === 'production' && isProductionBranch(mode),
SENTRY_RELEASE_NAME: JSON.stringify(sentryReleaseName(mode)),
},
plugins: [
command === 'build' &&
@ -109,6 +110,7 @@ export default defineConfig(({ command, mode }) => ({
release: {
// Use same release name as the one used in the app.
name: sentryReleaseName(mode),
inject: false, // Avoid adding imports with a hash in chunks, as this causes long term caching issues.
uploadLegacySourcemaps: {
paths: ['./dist'],
ignore: ['./node_modules'],