Skip to content

Commit

Permalink
fix: Disallow indexing if not production (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
soniaklimas authored and karolkarolka committed Dec 5, 2024
1 parent 8e4f108 commit 13b15ba
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion apps/storefront/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const nextConfig = withNextIntl({
serverComponentsExternalPackages: ["pino"],
},
images: {
// TODO: Required for the imagges to load on Chrome when deployed with Vercel.
// TODO: Required for the images to load on Chrome when deployed with Vercel.
// Remove when the issue is fixed.
loader: "custom",
loaderFile: "./src/lib/sanityImageLoader.ts",
Expand All @@ -50,6 +50,24 @@ const nextConfig = withNextIntl({
},
reactStrictMode: true,
transpilePackages: ["@nimara/ui"],
async headers() {
const headers = [];
if (
process.env.NEXT_PUBLIC_ENVIRONMENT === "DEVELOPMENT" ||
process.env.NEXT_PUBLIC_ENVIRONMENT === "STAGING"
) {
headers.push({
headers: [
{
key: "X-Robots-Tag",
value: "noindex",
},
],
source: "/:path*",
});
}
return headers;
},

webpack: (config, { isServer }) => {
if (isServer) {
Expand Down

0 comments on commit 13b15ba

Please sign in to comment.