-
Notifications
You must be signed in to change notification settings - Fork 27
/
next.config.withSentry.js
46 lines (42 loc) · 1.18 KB
/
next.config.withSentry.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// This file sets a custom webpack configuration to use your Next.js app
// with Sentry.
// https://nextjs.org/docs/api-reference/next.config.js/introduction
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
import { withSentryConfig } from '@sentry/nextjs'
/** @type {import('next').NextConfig} */
const nextConfig = {
// webpack: (config, { isServer, webpack }) => {
// if (!isServer) {
// // Ensures no server modules are included on the client.
// config.plugins.push(new webpack.IgnorePlugin(/lib\/server/));
// }
// return config;
// }, reactStrictMode: true,
swcMinify: true,
compiler: {
relay: {
src: './',
language: 'typescript',
artifactDirectory: '__generated__',
},
},
experimental: { appDir: true },
async rewrites() {
return [
{
source: '/@:handle([a-zA-Z0-9-_]+)/:id*',
destination: '/users/:handle/:id*',
},
{
source: '/story/:id([a-zA-Z0-9=+-/]+)___:suffix*',
destination: '/story/:id',
},
]
},
}
module.exports = nextConfig
module.exports = withSentryConfig(
module.exports,
{ silent: true },
{ hideSourcemaps: true }
)