Update legacy.js

Allow e.g. require-debug.js to work in findBase