This commit is contained in:
phaichayon
2026-07-16 16:35:56 +07:00
parent b75776827d
commit 3ec00e6e64
2 changed files with 114 additions and 31 deletions

View File

@@ -1,37 +1,37 @@
import type { NextConfig } from 'next';
import { withSentryConfig } from '@sentry/nextjs';
import type { NextConfig } from "next";
import { withSentryConfig } from "@sentry/nextjs";
// Define the base Next.js configuration
const baseConfig: NextConfig = {
output: process.env.BUILD_STANDALONE === 'true' ? 'standalone' : undefined,
output: "standalone",
images: {
remotePatterns: [
{
protocol: 'https',
hostname: 'api.slingacademy.com',
port: ''
protocol: "https",
hostname: "api.slingacademy.com",
port: "",
},
{
protocol: 'https',
hostname: 'placehold.co',
port: ''
protocol: "https",
hostname: "placehold.co",
port: "",
},
{
protocol: 'https',
hostname: 'img.clerk.com',
port: ''
protocol: "https",
hostname: "img.clerk.com",
port: "",
},
{
protocol: 'https',
hostname: 'clerk.com',
port: ''
}
]
protocol: "https",
hostname: "clerk.com",
port: "",
},
],
},
transpilePackages: ['geist'],
transpilePackages: ["geist"],
compiler: {
removeConsole: process.env.NODE_ENV === 'production'
}
removeConsole: process.env.NODE_ENV === "production",
},
};
let configWithPlugins = baseConfig;
@@ -48,7 +48,7 @@ if (!process.env.NEXT_PUBLIC_SENTRY_DISABLED) {
widenClientFileUpload: true,
// Route browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers.
tunnelRoute: '/monitoring',
tunnelRoute: "/monitoring",
// Disable Sentry telemetry
telemetry: false,
@@ -56,17 +56,19 @@ if (!process.env.NEXT_PUBLIC_SENTRY_DISABLED) {
// Sentry v10: moved under webpack namespace
webpack: {
reactComponentAnnotation: {
enabled: true
enabled: true,
},
treeshake: {
removeDebugLogging: true
}
removeDebugLogging: true,
},
},
// Disable source map upload when org/project are not configured
sourcemaps: {
disable: !process.env.NEXT_PUBLIC_SENTRY_ORG || !process.env.NEXT_PUBLIC_SENTRY_PROJECT
}
disable:
!process.env.NEXT_PUBLIC_SENTRY_ORG ||
!process.env.NEXT_PUBLIC_SENTRY_PROJECT,
},
});
}