Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions rspack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -846,15 +846,18 @@ if (IS_UI_DEV_ONLY || SENTRY_EXPERIMENTAL_SPA) {
}

if (IS_PRODUCTION) {
// This compression-webpack-plugin generates pre-compressed files
// ending in .gz, to be picked up and served by our internal static media
// server as well as nginx when paired with the gzip_static module.
appConfig.plugins?.push(
new CompressionPlugin({
algorithm: 'gzip',
test: /\.(js|map|css|svg|html|txt|ico|eot|ttf)$/,
})
);
if (!IS_DEPLOY_PREVIEW) {
// This compression-webpack-plugin generates pre-compressed files
// ending in .gz, to be picked up and served by our internal static media
// server as well as nginx when paired with the gzip_static module.
// Skipped for deploy previews since Vercel handles compression itself.
appConfig.plugins?.push(
new CompressionPlugin({
algorithm: 'gzip',
test: /\.(js|map|css|svg|html|txt|ico|eot|ttf)$/,
})
);
}

// Enable sentry-webpack-plugin for production builds
appConfig.plugins?.push(
Expand Down
9 changes: 9 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@
{
"source": "/api/(.*)",
"headers": [{"key": "Referer", "value": "https://sentry.io/"}]
},
{
"source": "/_assets/(chunks|assets)/(.*)",
"headers": [
{
"key": "Cache-Control",
"value": "public, max-age=31536000, immutable"
}
]
}
],
"github": {"silent": true}
Expand Down
Loading