Skip to content

Commit

Permalink
Merge pull request #5 from consolelabs/feat/sentry
Browse files Browse the repository at this point in the history
feat: sentry
  • Loading branch information
leduyhien152 authored Apr 15, 2024
2 parents b789da3 + 2145336 commit 7eb6d1f
Show file tree
Hide file tree
Showing 8 changed files with 471 additions and 10 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,6 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

# Sentry Config File
.sentryclirc
1 change: 1 addition & 0 deletions envs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ export const MOCHI_PAY_API = `${
export const MOCHI_API = `${
process.env.NEXT_PUBLIC_MOCHI_API_HOST || "mochi-api"
}/api/v1`;
export const SENTRY_DSN = process.env.NEXT_PUBLIC_SENTRY_DSN || "";
39 changes: 38 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { withSentryConfig } from "@sentry/nextjs";
/** @type {import('next').NextConfig} */
const nextConfig = {
images: {
Expand All @@ -11,4 +12,40 @@ const nextConfig = {
},
};

export default nextConfig;
export default withSentryConfig(
nextConfig,
{
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options

// Suppresses source map uploading logs during build
silent: true,
},
{
// For all available options, see:
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/

// Upload a larger set of source maps for prettier stack traces (increases build time)
widenClientFileUpload: true,

// Transpiles SDK to be compatible with IE11 (increases bundle size)
transpileClientSDK: true,

// Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers. (increases server load)
// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
// side errors will fail.
tunnelRoute: "/monitoring",

// Hides source maps from generated client bundles
hideSourceMaps: true,

// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,

// Enables automatic instrumentation of Vercel Cron Monitors.
// See the following for more information:
// https://docs.sentry.io/product/crons/
// https://vercel.com/docs/cron-jobs
automaticVercelMonitors: true,
}
);
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"bignumber.js": "^9.1.2",
"@sentry/nextjs": "^7.107.0",
"clsx": "^2.1.0",
"ethers": "5.7.2",
"next": "14.1.3",
Expand Down
Loading

0 comments on commit 7eb6d1f

Please sign in to comment.