Frontend/next.config.mjs
Liam 0b9a112c5b
Some checks failed
Deploy App / docker (ubuntu-latest) (push) Failing after 40s
maybe fix?
2024-04-21 20:18:01 +01:00

66 lines
1.6 KiB
JavaScript

import { withSentryConfig } from "@sentry/nextjs";
import nextBuildId from "next-build-id";
import { fileURLToPath } from "url";
import path from "path";
/**
* The current git commit hash.
*
* @type {string|string} The current git commit hash.
*/
const buildId = (
process.env.GIT_REV || nextBuildId.sync({ dir: path.dirname(fileURLToPath(import.meta.url)) })
).substring(0, 7);
/** @type {import('next').NextConfig} */
const nextConfig = {
output: "standalone",
images: {
remotePatterns: [
{
protocol: "https",
hostname: "git.fascinated.cc",
pathname: "/**",
},
{
protocol: "https",
hostname: "api.mcutils.xyz",
pathname: "/**",
},
],
},
env: {
NEXT_PUBLIC_BUILD_ID: buildId,
},
experimental: {
mdxRs: true,
},
};
export default withSentryConfig(
nextConfig,
{
// For all available options, see:
// https://github.com/getsentry/sentry-webpack-plugin#options
silent: true,
org: "minecraft-utilities",
project: "frontend",
url: "https://glitchtip.fascinated.cc/",
authToken: process.env.SENTRY_AUTH_TOKEN || "",
release: `frontend@${buildId}`,
},
{
// 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,
// Hides source maps from generated client bundles
hideSourceMaps: true,
// Automatically tree-shake Sentry logger statements to reduce bundle size
disableLogger: true,
},
);