infoalloggi-monorepo/apps/infoalloggi/next.config.ts
Marco Pedone 208deeac28 Refactor image handling in announcement components
- Updated CardAnnuncio and related components to use a new images structure instead of url_immagini.
- Removed references to url_immagini and replaced them with images array containing img and thumb properties.
- Adjusted API responses to include images in the new format.
- Modified middleware and storage service to accommodate new image handling.
- Cleaned up unused code and schemas related to old image references.
- Updated Docker configuration for storage service.
2025-10-27 17:58:42 +01:00

76 lines
1.6 KiB
TypeScript

/**
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation.
* This is especially useful for Docker builds.
*/
import { fileURLToPath } from "node:url";
import type { NextConfig } from "next";
import { env } from "~/env";
async function createNextConfig(): Promise<NextConfig> {
const { createJiti } = await import("jiti");
const jiti = createJiti(fileURLToPath(import.meta.url));
await jiti.import("./src/env.ts");
return {
compiler: {
removeConsole: false,
},
experimental: {
// esmExternals: "loose", // This if react-pdf gives compilation issues
},
devIndicators: false,
headers: async () => {
return [
{
headers: [
{
key: "X-Frame-Options",
value: "",
},
],
source: "/:path*",
},
];
},
i18n: {
defaultLocale: "it",
locales: ["it", "en"],
localeDetection: false,
},
images: {
unoptimized: true,
minimumCacheTTL: 7200,
remotePatterns: [
{
hostname: "*.googleusercontent.com",
pathname: "**",
port: "",
protocol: "https",
},
{
hostname: `${env.STORAGE_URL}`,
},
],
},
output: env.NODE_ENV === "production" ? "standalone" : undefined, // This is for docker builds
transpilePackages: ["@t3-oss/env-nextjs", "@t3-oss/env-core"],
reactStrictMode: true,
rewrites: async () => {
return [
{
destination: env.NODE_ENV === "production" ? "/404" : "/api/panel",
source: "/api/panel",
},
];
},
typescript: {
ignoreBuildErrors: true,
},
};
}
export default (async () => await createNextConfig())();