Files
captable/next.config.js
T

67 lines
1.6 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import withBundleAnalyzer from "@next/bundle-analyzer";
import { withSentryConfig } from "@sentry/nextjs";
const bundleAnalyzer = withBundleAnalyzer({
enabled: process.env.ANALYZE === "true",
});
/**
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful
* for Docker builds.
*/
await import("./src/env.js");
/** @type {import("next").NextConfig} */
const nextConfig = {
output: process.env.DOCKER_OUTPUT ? "standalone" : undefined,
images: {
remotePatterns: [
{
hostname: "randomuser.me",
protocol: "https",
},
{
hostname: "avatars.githubusercontent.com",
protocol: "https",
},
],
},
webpack: (config, { isServer }) => {
/**
* Critical: prevents " ⨯ ./node_modules/canvas/build/Release/canvas.node
* Module parse failed: Unexpected character '�' (1:0)" error
*/
config.resolve.alias.canvas = false;
if (isServer) {
config.ignoreWarnings = [{ module: /opentelemetry/ }];
}
return config;
},
experimental: {
instrumentationHook: true,
serverComponentsExternalPackages: ["pino", "pino-pretty"],
},
eslint: {
ignoreDuringBuilds: true,
},
};
const hasSentry = !!(
process.env.SENTRY_ORG &&
process.env.SENTRY_PROJECT &&
process.env.NEXT_PUBLIC_SENTRY_DSN
);
export default hasSentry
? withSentryConfig(bundleAnalyzer(nextConfig), {
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
silent: true,
widenClientFileUpload: true,
hideSourceMaps: true,
disableLogger: true,
})
: bundleAnalyzer(nextConfig);