Ensure development logging code is stripped out in production

From !5385 (comment 2920125482)

@gitlab/ui's dev logging: it is not stripped out of the production build.

The isDev check is always run by the logWarning function, even in production.

It looks like process.env.NODE_ENV is not replaced with "production", e.g., in https://app.unpkg.com/@gitlab/ui@126.3.0/files/dist/directives/outside/outside.js#L35. So there's clearly something not quite right with out build set up.

Having said all of that, everything consumes @gitlab/ui from source nowadays, so it matters more how tools like Webpack and Vite handle these things.

Tasks

  • Inspect the Webpack production build of gitlab-org/gitlab to determine whether logging statements are stipped
  • Do the same for the Vite production build