-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnext.config.ts
50 lines (45 loc) · 1.31 KB
/
next.config.ts
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
47
48
49
50
import { codecovNextJSWebpackPlugin } from '@codecov/nextjs-webpack-plugin';
import withBundleAnalyzer from '@next/bundle-analyzer';
import { withSentryConfig } from '@sentry/nextjs';
import type { NextConfig } from 'next';
import { webpack } from 'next/dist/compiled/webpack/webpack';
// Config
const nextConfig: NextConfig = {
webpack(config: NextConfig, options) {
config.plugins.push(
codecovNextJSWebpackPlugin({
enableBundleAnalysis: !!process.env.CODECOV_TOKEN,
bundleName: 'palantir',
uploadToken: process.env.CODECOV_TOKEN,
webpack: options.webpack,
}),
new webpack.DefinePlugin({
__RRWEB_EXCLUDE_IFRAME__: true,
})
);
return config;
}
};
// Plugins
const plugins = [
withBundleAnalyzer({
enabled: process.env.ANALYZE === 'true'
}),
(config: NextConfig) => withSentryConfig(config, {
org: 'jujulego',
project: 'palantir',
automaticVercelMonitors: true,
disableLogger: true,
reactComponentAnnotation: {
enabled: true,
},
silent: !process.env.CI,
sourcemaps: {
disable: !process.env.CI,
deleteSourcemapsAfterUpload: true,
},
tunnelRoute: '/monitoring',
widenClientFileUpload: !!process.env.CI,
})
];
export default plugins.reduce((cfg, plugin) => plugin(cfg), nextConfig);