using gsub to remove require tree, which removes javascript error in Chrome