export let add;if (process.env.NODE_ENV === 'development') { const _add = (a, b) => { return a + b; }; add = _add;}else { const _add = (a, b) => a + b; add = _add;}
The condition can then be stripped by tools such as webpack or rollup, so you only get one of the branches in production, but library authors can ship a one set of file that covers both debug and production use cases.