PBL-5649: Make sure we don't generate JS files unless JS actually exists.