Files
Suman/apps/suman-hrvatska/next.config.js
Nermin Karic f5e2fcbf98 first commit
2026-11-22 21:49:17 +01:00

80 lines
1.7 KiB
JavaScript

const checkEnvVariables = require("./check-env-variables")
checkEnvVariables()
/**
* Medusa Cloud-related environment variables
*/
const S3_HOSTNAME = process.env.MEDUSA_CLOUD_S3_HOSTNAME
const S3_PATHNAME = process.env.MEDUSA_CLOUD_S3_PATHNAME
/**
* @type {import('next').NextConfig}
*/
const nextConfig = {
reactStrictMode: true,
async headers() {
return [
{
source: "/:path*",
headers: [{ key: "Link", value: '</.well-known/ucp>; rel="ucp"' }],
},
{
source: "/:countryCode/products/:handle",
headers: [{ key: "Vary", value: "Accept" }],
},
]
},
async rewrites() {
return {
beforeFiles: [
{
source: "/:countryCode/products/:handle([^/.]+).md",
destination: "/:countryCode/products/:handle/markdown",
},
{
source: "/:countryCode/products/:handle([^/.]+)",
has: [{ type: "header", key: "accept", value: ".*text/markdown.*" }],
destination: "/:countryCode/products/:handle/markdown",
},
],
}
},
logging: {
fetches: {
fullUrl: true,
},
},
typescript: {
ignoreBuildErrors: true,
},
images: {
unoptimized: true,
remotePatterns: [
{
protocol: "http",
hostname: "localhost",
},
{
protocol: "https",
hostname: "*.s3.*.amazonaws.com",
},
{
protocol: "https",
hostname: "*.s3.amazonaws.com",
},
...(S3_HOSTNAME && S3_PATHNAME
? [
{
protocol: "https",
hostname: S3_HOSTNAME,
pathname: S3_PATHNAME,
},
]
: []),
],
},
}
module.exports = nextConfig