I think it'd be better to use the existing cordova/modulemapper module instead of writing another one.