vega-frontend-monorepo/apps/trading/next.config.js
Matthew Russell 018e5fe139
Task/33 add sentry to trading (#189)
* add sentry setup, add VEGA_ENV to env files

* rename custom error page

* capture exception for eager connect

* add link to setup docs in comment

* add browser tracing plugin

* define sentry auth token once

* enable sourcemaps on build

* use correct sentry config property
2022-04-04 12:45:40 -07:00

32 lines
832 B
JavaScript

// eslint-disable-next-line @typescript-eslint/no-var-requires
const withNx = require('@nrwl/next/plugins/with-nx');
const { withSentryConfig } = require('@sentry/nextjs');
const SENTRY_AUTH_TOKEN = process.env.SENTRY_AUTH_TOKEN;
const sentryWebpackOptions = {
org: 'vega-o3',
project: 'trading',
token: SENTRY_AUTH_TOKEN,
};
/**
* @type {import('@nrwl/next/plugins/with-nx').WithNxOptions}
**/
const nextConfig = {
nx: {
// Set this to true if you would like to to use SVGR
// See: https://github.com/gregberge/svgr
svgr: false,
},
pageExtensions: ['page.tsx', 'page.jsx'],
experimental: {
// https://github.com/vercel/next.js/issues/32360
esmExternals: false,
},
};
module.exports = SENTRY_AUTH_TOKEN
? withNx(withSentryConfig(nextConfig, sentryWebpackOptions))
: withNx(nextConfig);