Skip to content

Commit 8d0301d

Browse files
committed
fix(e2e): Exclude Sentry packages from Vite pre-bundling
This forces Vite to use rollup for bundling Sentry packages, which properly respects the resolve.conditions setting for dev builds.
1 parent ba2aec7 commit 8d0301d

File tree

1 file changed

+11
-0
lines changed
  • dev-packages/e2e-tests/test-applications/browser-spotlight

1 file changed

+11
-0
lines changed

dev-packages/e2e-tests/test-applications/browser-spotlight/vite.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ export default defineConfig({
77
build: {
88
// Output to 'build' directory to match existing setup
99
outDir: 'build',
10+
// Don't minify to help with debugging
11+
minify: false,
12+
// Bundle Sentry packages so we can control the resolution
13+
rollupOptions: {
14+
// Force rollup to resolve with our conditions
15+
},
1016
},
1117
preview: {
1218
port: 3030,
@@ -19,6 +25,11 @@ export default defineConfig({
1925
// - development: Spotlight code included
2026
conditions: ['development'],
2127
},
28+
// Disable pre-bundling (esbuild) for Sentry packages
29+
// This ensures Vite uses our resolve.conditions when bundling
30+
optimizeDeps: {
31+
exclude: ['@sentry/react', '@sentry/browser', '@sentry/core', '@sentry-internal/browser-utils'],
32+
},
2233
define: {
2334
// Define env vars for the E2E test
2435
// VITE_SENTRY_SPOTLIGHT is read automatically by @sentry/react via import.meta.env

0 commit comments

Comments
 (0)