Added a promise hook for require functions.