2024-03-26 13:54:42 +00:00
|
|
|
/* eslint-disable @typescript-eslint/no-var-requires */
|
2023-08-08 07:25:42 +00:00
|
|
|
/** @type {import('next').NextConfig} */
|
2023-12-07 09:13:33 +00:00
|
|
|
require("dotenv").config({ path: ".env" });
|
|
|
|
const { withSentryConfig } = require("@sentry/nextjs");
|
2023-08-08 07:25:42 +00:00
|
|
|
|
2023-09-03 15:25:37 +00:00
|
|
|
const nextConfig = {
|
2024-05-08 17:31:20 +00:00
|
|
|
trailingSlash: true,
|
2024-05-09 15:35:51 +00:00
|
|
|
output: "standalone",
|
|
|
|
basePath: process.env.NEXT_PUBLIC_SPACE_BASE_PATH || "",
|
|
|
|
reactStrictMode: false,
|
|
|
|
swcMinify: true,
|
2023-12-20 08:19:17 +00:00
|
|
|
async headers() {
|
|
|
|
return [
|
|
|
|
{
|
|
|
|
source: "/",
|
2024-05-09 15:35:51 +00:00
|
|
|
headers: [{ key: "X-Frame-Options", value: "SAMEORIGIN" }], // clickjacking protection
|
2023-12-20 08:19:17 +00:00
|
|
|
},
|
|
|
|
];
|
|
|
|
},
|
2023-10-27 07:44:03 +00:00
|
|
|
images: {
|
2023-12-20 08:19:17 +00:00
|
|
|
remotePatterns: [
|
|
|
|
{
|
|
|
|
protocol: "https",
|
|
|
|
hostname: "**",
|
|
|
|
},
|
|
|
|
],
|
2023-10-27 07:44:03 +00:00
|
|
|
unoptimized: true,
|
|
|
|
},
|
2023-09-03 15:25:37 +00:00
|
|
|
};
|
2023-08-08 07:25:42 +00:00
|
|
|
|
2024-05-27 09:51:41 +00:00
|
|
|
|
|
|
|
const sentryConfig = {
|
|
|
|
// For all available options, see:
|
|
|
|
// https://github.com/getsentry/sentry-webpack-plugin#options
|
|
|
|
|
|
|
|
org: process.env.SENTRY_ORG_ID || "plane-hq",
|
|
|
|
project: process.env.SENTRY_PROJECT_ID || "plane-space",
|
|
|
|
authToken: process.env.SENTRY_AUTH_TOKEN,
|
|
|
|
// Only print logs for uploading source maps in CI
|
|
|
|
silent: true,
|
|
|
|
|
|
|
|
// For all available options, see:
|
|
|
|
// https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/
|
|
|
|
|
|
|
|
// Upload a larger set of source maps for prettier stack traces (increases build time)
|
|
|
|
widenClientFileUpload: true,
|
|
|
|
|
|
|
|
// Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
|
|
|
|
// This can increase your server load as well as your hosting bill.
|
|
|
|
// Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of client-
|
|
|
|
// side errors will fail.
|
|
|
|
tunnelRoute: "/monitoring",
|
|
|
|
|
|
|
|
// Hides source maps from generated client bundles
|
|
|
|
hideSourceMaps: true,
|
|
|
|
|
|
|
|
// Automatically tree-shake Sentry logger statements to reduce bundle size
|
|
|
|
disableLogger: true,
|
|
|
|
|
|
|
|
// Enables automatic instrumentation of Vercel Cron Monitors. (Does not yet work with App Router route handlers.)
|
|
|
|
// See the following for more information:
|
|
|
|
// https://docs.sentry.io/product/crons/
|
|
|
|
// https://vercel.com/docs/cron-jobs
|
|
|
|
automaticVercelMonitors: true,
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-05-27 09:32:03 +00:00
|
|
|
if (parseInt(process.env.SENTRY_MONITORING_ENABLED || "0", 10)) {
|
2024-05-27 09:51:41 +00:00
|
|
|
module.exports = withSentryConfig(nextConfig, sentryConfig);
|
2023-09-03 15:25:37 +00:00
|
|
|
} else {
|
|
|
|
module.exports = nextConfig;
|
|
|
|
}
|
2024-05-27 09:51:41 +00:00
|
|
|
|