-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathnext.config.mjs
More file actions
56 lines (53 loc) · 1.43 KB
/
next.config.mjs
File metadata and controls
56 lines (53 loc) · 1.43 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
import path from "path";
import { fileURLToPath } from "url";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
/** @type {import('next').NextConfig} */
const nextConfig = {
basePath: "/tracker",
transpilePackages: ["chartjs-adapter-date-fns"],
webpack: (config) => {
// Force all chart.js imports to resolve to the same instance
// (pnpm creates separate copies for react-chartjs-2)
config.resolve.alias["chart.js"] = path.resolve(
__dirname,
"node_modules/chart.js",
);
return config;
},
typescript: {
ignoreBuildErrors: true,
},
images: {
unoptimized: true,
},
skipTrailingSlashRedirect: true,
async rewrites() {
return [
{
source: "/ph/static/:path*",
destination: "https://us-assets.i.posthog.com/static/:path*",
},
{
source: "/ph/decide",
destination: "https://us.i.posthog.com/decide",
},
{
source: "/ph/:path*",
destination: "https://us.i.posthog.com/:path*",
},
{
source: "/api/v1/:path*",
destination: `${process.env.NEXT_PUBLIC_API_URL}/:path*`,
},
{
source: "/api/burndown/:path*",
destination: `${process.env.NEXT_PUBLIC_API_URL}/api/burndown/:path*`,
},
{
source: "/api/dashboard/:path*",
destination: `${process.env.NEXT_PUBLIC_API_URL}/api/dashboard/:path*`,
},
];
},
};
export default nextConfig;