Update replace.js

Fix incorrect reference to `modulePath`. By the time it is referenced, its parent object `file` has already been reassigned to a string.