import 'something';
And then create separate versions of 'something.js' for debug and release, where your release version just has stubs: export function debugPrint(msg) {}
While the debug version might use console.log or winston or whatever.If you compile your JS and the compiler provides tree-shaking, the calls will get optimized out entirely. Even if you don't, you can deploy the no-ops to prod and it'll use minimal bandwidth and no CPU time. And the best part is that it keeps the syntax of your code very clean; you don't have to litter your code with "if (DEBUG)", you just have it do what it needs to and those calls will equal doing nothing in prod.