Fixes #5581 check if require is already defined so that we don't overwrite the require function with a config object if loading a full page through ajax