[BUGFIX beta] Ensure production builds do not use require internally.

Closes #5512.
Closes #4994.