Refactoring build for scalsjs