forked from Remitwise-Org/Remitwise-Frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnext.config.js
More file actions
63 lines (54 loc) · 1.52 KB
/
Copy pathnext.config.js
File metadata and controls
63 lines (54 loc) · 1.52 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
const { withSentryConfig } = require("@sentry/nextjs");
const withBundleAnalyzer = require("@next/bundle-analyzer")({
enabled: process.env.ANALYZE === "true",
});
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
// Issue #1437 – the bundle-size measurement workflow builds with
// CI_SKIP_TYPECHECK=1: bundle size is orthogonal to the repo's known
// type-error backlog (tracked separately), and measurement must not be
// hostage to it. Default builds still typecheck.
typescript: {
ignoreBuildErrors: process.env.CI_SKIP_TYPECHECK === "1",
},
};
const rewrites = async () => {
return [
{
source: "/api/:path*",
destination: "/api/v1/:path*",
},
];
};
// Insights routes consolidated into the canonical /financial-insights page.
// Permanent (308) redirects keep existing bookmarks/links alive.
const redirects = async () => {
return [
{
source: "/insights",
destination: "/financial-insights",
permanent: true,
},
{
source: "/financial-insight",
destination: "/financial-insights",
permanent: true,
},
];
};
const sentryWebpackPluginOptions = {
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
authToken: process.env.SENTRY_AUTH_TOKEN,
silent: !process.env.CI,
tunnelRoute: "/monitoring",
hideSourceMaps: true,
disableLogger: true,
};
module.exports = withBundleAnalyzer(
withSentryConfig(
{ ...nextConfig, rewrites, redirects },
sentryWebpackPluginOptions
)
);