The reality is more complicated than simply saying one type is clean and the other is dirty.
Producing any car requires energy, raw materials, factories, transportation, and infrastructure.
The environmental impact of a vehicle needs to be considered across its full life cycle.