That would still make them cleaner than a diesel ICE truck. Since the generator can continuously run at a constant rpm where the engine burns the fuel efficiently. So that would also generate the least particulate matter since the burn would be cleaner.
There is a Canadian company called Edison who will retrofit a truck into a hybrid. They add two electric axle engines and convert the IC engine into a generator to charge the batteries.
There are videos that walk through how to "de-pussify" (or some other misogynistic term) cyber trucks to make them run on diesel. I don't know enough about cars or cyber trucks to know how valid they are.