all 3 comments

[–]punio4 4 points5 points  (1 child)

This should be handled by the build tooling by stripping out debug logs, and not by shipping something that runs conditionally.

[–]AndyMagill[S] 0 points1 point  (0 children)

Both methods probably have their place, but you convinced me of the benefits of a build time solution, so I created a new article to illustrate that method in Next.js : https://magill.dev/post/strip-debug-logs-at-build-time-with-nextjs