2024-05-28 17:26:08 +05:30
|
|
|
|
import withBundleAnalyzer from "@next/bundle-analyzer";
|
2024-06-19 07:41:01 +05:45
|
|
|
|
import { withSentryConfig } from "@sentry/nextjs";
|
2024-05-28 17:26:08 +05:30
|
|
|
|
|
|
|
|
|
|
const bundleAnalyzer = withBundleAnalyzer({
|
2024-05-28 17:15:48 +05:30
|
|
|
|
enabled: process.env.ANALYZE === "true",
|
|
|
|
|
|
});
|
|
|
|
|
|
|
2024-01-08 21:34:22 -06:00
|
|
|
|
/**
|
|
|
|
|
|
* 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} */
|
2024-06-19 07:41:01 +05:45
|
|
|
|
const nextConfig = {
|
2024-05-12 02:36:56 -05:00
|
|
|
|
output: process.env.DOCKER_OUTPUT ? "standalone" : undefined,
|
2024-01-17 00:27:26 -06:00
|
|
|
|
images: {
|
2024-03-05 09:46:58 +05:30
|
|
|
|
remotePatterns: [
|
|
|
|
|
|
{
|
|
|
|
|
|
hostname: "randomuser.me",
|
|
|
|
|
|
protocol: "https",
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
hostname: "avatars.githubusercontent.com",
|
|
|
|
|
|
protocol: "https",
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
2024-01-17 00:27:26 -06:00
|
|
|
|
},
|
2024-06-26 00:49:14 -05:00
|
|
|
|
webpack: (config, { isServer }) => {
|
2024-02-16 08:09:39 +05:30
|
|
|
|
/**
|
|
|
|
|
|
* Critical: prevents " ⨯ ./node_modules/canvas/build/Release/canvas.node
|
|
|
|
|
|
* Module parse failed: Unexpected character '�' (1:0)" error
|
|
|
|
|
|
*/
|
|
|
|
|
|
config.resolve.alias.canvas = false;
|
|
|
|
|
|
|
2024-06-26 00:49:14 -05:00
|
|
|
|
if (isServer) {
|
|
|
|
|
|
config.ignoreWarnings = [{ module: /opentelemetry/ }];
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2024-02-16 08:09:39 +05:30
|
|
|
|
return config;
|
|
|
|
|
|
},
|
2024-05-14 06:33:20 +05:30
|
|
|
|
experimental: {
|
|
|
|
|
|
instrumentationHook: true,
|
2024-08-07 12:54:17 +05:30
|
|
|
|
serverComponentsExternalPackages: [
|
|
|
|
|
|
"pino",
|
|
|
|
|
|
"pino-pretty",
|
|
|
|
|
|
"pdf-lib",
|
|
|
|
|
|
"@aws-sdk/s3-request-presigner",
|
2024-08-29 13:58:54 +05:30
|
|
|
|
"@react-pdf/renderer",
|
2024-08-07 12:54:17 +05:30
|
|
|
|
],
|
2024-05-14 06:33:20 +05:30
|
|
|
|
},
|
2024-05-15 12:27:56 +05:30
|
|
|
|
eslint: {
|
2024-05-28 00:11:04 +05:30
|
|
|
|
ignoreDuringBuilds: true,
|
2024-05-15 12:27:56 +05:30
|
|
|
|
},
|
2026-03-01 23:16:27 -08:00
|
|
|
|
typescript: {
|
|
|
|
|
|
ignoreBuildErrors: true,
|
|
|
|
|
|
},
|
2024-01-17 00:27:26 -06:00
|
|
|
|
};
|
2024-01-08 21:34:22 -06:00
|
|
|
|
|
2024-06-24 23:31:28 +05:30
|
|
|
|
const hasSentry = !!(
|
|
|
|
|
|
process.env.SENTRY_ORG &&
|
|
|
|
|
|
process.env.SENTRY_PROJECT &&
|
|
|
|
|
|
process.env.NEXT_PUBLIC_SENTRY_DSN
|
|
|
|
|
|
);
|
2024-06-19 07:41:01 +05:45
|
|
|
|
|
|
|
|
|
|
export default hasSentry
|
2024-06-24 23:31:28 +05:30
|
|
|
|
? withSentryConfig(bundleAnalyzer(nextConfig), {
|
|
|
|
|
|
org: process.env.SENTRY_ORG,
|
|
|
|
|
|
project: process.env.SENTRY_PROJECT,
|
|
|
|
|
|
silent: true,
|
|
|
|
|
|
widenClientFileUpload: true,
|
|
|
|
|
|
hideSourceMaps: true,
|
|
|
|
|
|
disableLogger: true,
|
|
|
|
|
|
})
|
2024-06-19 07:41:01 +05:45
|
|
|
|
: bundleAnalyzer(nextConfig);
|