plane/web/next.config.js

48 lines
1.1 KiB
JavaScript
Raw Normal View History

2024-03-26 13:54:42 +00:00
/* eslint-disable @typescript-eslint/no-var-requires */
require("dotenv").config({ path: ".env" });
const { withSentryConfig } = require("@sentry/nextjs");
2022-11-19 14:21:26 +00:00
const nextConfig = {
2024-04-06 11:43:24 +00:00
reactStrictMode: false,
swcMinify: true,
output: "standalone",
async headers() {
return [
{
source: "/(.*)?",
headers: [{ key: "X-Frame-Options", value: "SAMEORIGIN" }],
},
];
},
2022-11-19 14:21:26 +00:00
images: {
remotePatterns: [
{
protocol: "https",
hostname: "**",
},
],
unoptimized: true,
2022-11-19 14:21:26 +00:00
},
2024-04-06 11:43:24 +00:00
async rewrites() {
return [
{
source: "/ingest/static/:path*",
destination: "https://us-assets.i.posthog.com/static/:path*",
},
{
source: "/ingest/:path*",
destination: "https://us.i.posthog.com/:path*",
},
]
}
2022-11-19 14:21:26 +00:00
};
2024-04-02 11:15:18 +00:00
if (parseInt(process.env.NEXT_PUBLIC_ENABLE_SENTRY || "0", 10)) {
2024-03-26 13:54:42 +00:00
module.exports = withSentryConfig(nextConfig,
{ silent: true, authToken: process.env.SENTRY_AUTH_TOKEN },
{ hideSourceMaps: true }
);
2023-02-08 15:14:35 +00:00
} else {
module.exports = nextConfig;
}