Technically, it doesn't really matter. require
is just a normal method call, and the scope it's called in doesn't affect how it works. The only difference placement makes is that it will be executed when whatever code it's placed in is evaluated.
Practically speaking, you should put them at top so people can see the file's dependencies at a glance. That's the traditional place for it.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…