-
Notifications
You must be signed in to change notification settings - Fork 3
/
next.config.js
45 lines (40 loc) · 1.04 KB
/
next.config.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
const { version } = require('./package.json');
const { withSentryConfig } = require('@sentry/nextjs');
const isProd = process.env.NODE_ENV === 'production';
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
env: {
WEB_VERSION: version,
},
eslint: {
ignoreDuringBuilds: true,
},
experimental: {
appDir: false,
forceSwcTransforms: true,
},
pageExtensions: ['page.tsx', 'page.ts', 'api.tsx', 'api.ts'],
swcMinify: true,
compiler: {
emotion: true,
reactRemoveProperties: isProd && {
properties: ['^data-testid'],
},
removeConsole: isProd && {
exclude: ['error', 'warn'],
},
},
sentry: {
hideSourceMaps: true,
},
transpilePackages: ['react-hotjar'],
};
const sentryWebpackPluginOptions = {
silent: true,
authToken: process.env.NEXT_PUBLIC_SENTRY_AUTH_TOKEN,
};
module.exports = () => {
const plugins = [[withSentryConfig, sentryWebpackPluginOptions]];
return plugins.reduce((acc, cur) => cur[0](acc, cur[1] ?? undefined), nextConfig);
};