merge predefined and compiled JavaScript cleanly