Skip to content

chore(build): strip console.* from production builds#30

Open
abdout wants to merge 1 commit into
mainfrom
chore/build-remove-console
Open

chore(build): strip console.* from production builds#30
abdout wants to merge 1 commit into
mainfrom
chore/build-remove-console

Conversation

@abdout
Copy link
Copy Markdown
Contributor

@abdout abdout commented Apr 25, 2026

Summary

  • 69 `console.*` calls across 30 files were shipping to prod. Adds `compiler.removeConsole` keyed to NODE_ENV.
  • Excludes `error` and `warn` so genuine production issues still emit.
  • Dev mode unchanged.

Changes

  • `next.config.ts` — add `compiler.removeConsole` block

Test plan

  • `pnpm build && grep -rE 'console\.(log\|debug\|info)' .next/server | wc -l` shows significant reduction
  • `console.error` and `console.warn` still emit in prod
  • `pnpm dev` unchanged

Closes #29

🤖 Generated with Claude Code

69 console.* calls across 30 files were shipping to production. Adds
compiler.removeConsole keyed to NODE_ENV, excluding error and warn so
genuine errors still reach Vercel logs.

Closes #29

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marketing Ready Ready Preview, Comment Apr 25, 2026 1:57pm

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.

chore(build): strip console.* from production via compiler.removeConsole

1 participant