Files

76 lines
1.8 KiB
JavaScript
Raw Permalink Normal View History

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 = {
output: process.env.DOCKER_OUTPUT ? "standalone" : undefined,
2024-01-17 00:27:26 -06:00
images: {
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 }) => {
/**
* 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/ }];
}
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
},
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);