Skip to content

Conversation

@japinderofficial-hub
Copy link

Enhanced the project configuration for improved build efficiency, security, and scalability:

Added modern image formats (avif, webp) for faster load times

Removed console logs in production for cleaner builds

Added security headers (X-Frame-Options, Referrer Policy, etc.)

Enabled experimental features (scrollRestoration, serverActions)

Improved readability and maintainability with constants

@netlify
Copy link

netlify bot commented Oct 31, 2025

Deploy Preview for reactkolkata failed. Why did it fail? →

Name Link
🔨 Latest commit 3bb877b
🔍 Latest deploy log https://app.netlify.com/projects/reactkolkata/deploys/69057b288a2a3500083df6b4

Copilot AI review requested due to automatic review settings February 5, 2026 14:13
@netlify
Copy link

netlify bot commented Feb 5, 2026

Deploy Preview for reactkolkata failed. Why did it fail? →

Name Link
🔨 Latest commit 50ec3ff
🔍 Latest deploy log https://app.netlify.com/projects/reactkolkata/deploys/6984a58b5e3e5e0008053126

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR attempts to optimize the Next.js configuration by adding security headers, modern image formats, console removal in production, and experimental features. However, the configuration file is incorrectly named as next.config1.ts instead of next.config.ts, which means it won't be used by Next.js.

Changes:

  • Added security headers (X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy)
  • Configured compiler to remove console logs in production (except errors)
  • Refactored remote image patterns into a constant array for better maintainability
  • Modified experimental features (removed optimizePackageImports, added scrollRestoration and serverActions)
  • Changed ESLint and source map configurations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +38 to +41
scrollRestoration: true, // UX improvement for back/forward navigation
serverActions: true, // Future scalability for server-side logic
},

Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The scrollRestoration experimental option does not exist in Next.js. The framework handles scroll restoration automatically through the built-in router. This configuration will have no effect and should be removed.

Suggested change
scrollRestoration: true, // UX improvement for back/forward navigation
serverActions: true, // Future scalability for server-side logic
},
serverActions: true, // Future scalability for server-side logic
},

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,60 @@
// next.config.ts
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is named 'next.config1.ts' but should be named 'next.config.ts' to be recognized by Next.js. The current working configuration file is 'next.config.ts' in the root directory. This new file will not be used by Next.js unless the existing 'next.config.ts' is removed or renamed.

Copilot uses AI. Check for mistakes.
"hashnode.imgix.net",
"avatars.githubusercontent.com",
"media.licdn.com",
"media-exp1.licdn.com",
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The remote image host 'images.lumacdn.com' is missing from REMOTE_IMAGE_HOSTS. This host is currently configured in the existing next.config.ts file and is actively used in the codebase (see src/base/data/dummy/index.ts line 12). Removing it will cause images from this domain to fail loading.

Suggested change
"media-exp1.licdn.com",
"media-exp1.licdn.com",
"images.lumacdn.com",

Copilot uses AI. Check for mistakes.

const nextConfig: NextConfig = {
reactStrictMode: true, // Helps catch bugs early
swcMinify: true, // Faster, more efficient minification
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The swcMinify option is deprecated in Next.js 13+ and enabled by default. This configuration line has no effect and should be removed. SWC minification is automatically used in modern Next.js versions.

Suggested change
swcMinify: true, // Faster, more efficient minification

Copilot uses AI. Check for mistakes.
const nextConfig: NextConfig = {
reactStrictMode: true, // Helps catch bugs early
swcMinify: true, // Faster, more efficient minification
productionBrowserSourceMaps: false, // Security improvement
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting productionBrowserSourceMaps to false unconditionally removes source maps in production. The existing configuration (next.config.ts line 12) conditionally enables source maps based on NEXT_PUBLIC_NODE_ENV, which is more flexible for debugging production issues. Consider whether completely disabling production source maps aligns with your debugging needs.

Suggested change
productionBrowserSourceMaps: false, // Security improvement
productionBrowserSourceMaps:
process.env.NEXT_PUBLIC_NODE_ENV === "production-debug", // Enable source maps only for explicit debug builds

Copilot uses AI. Check for mistakes.
output: "standalone",

eslint: {
ignoreDuringBuilds: true, // Avoid blocking builds in CI/CD
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enabling ignoreDuringBuilds will skip ESLint checks during builds. While this may speed up CI/CD, it means linting errors will not block deployments. The existing next.config.ts has this commented out, suggesting a deliberate decision to keep linting enabled during builds. Consider whether bypassing linting checks aligns with your code quality standards.

Suggested change
ignoreDuringBuilds: true, // Avoid blocking builds in CI/CD
ignoreDuringBuilds: false, // Keep linting enabled so build-breaking issues are caught

Copilot uses AI. Check for mistakes.

experimental: {
scrollRestoration: true, // UX improvement for back/forward navigation
serverActions: true, // Future scalability for server-side logic
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The experimental.serverActions option has been stable since Next.js 14 and is enabled by default. In Next.js 16.1.5 (the version used in this project), this configuration has no effect and should be removed.

Suggested change
serverActions: true, // Future scalability for server-side logic

Copilot uses AI. Check for mistakes.
Comment on lines +37 to +40
experimental: {
scrollRestoration: true, // UX improvement for back/forward navigation
serverActions: true, // Future scalability for server-side logic
},
Copy link

Copilot AI Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The optimizePackageImports experimental feature has been removed. The existing configuration optimizes imports for 'lucide-react' and 'framer-motion', which are both used in this project (see package.json). Removing this optimization may negatively impact bundle size and initial load performance. Consider retaining this configuration alongside the new changes.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants