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 Nov 27, 2024
1 parent 0740924 commit afec44f
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 @@ -38,7 +38,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 @@ -51,6 +51,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 afec44f

Please sign in to comment.