A small 200W-400W inverter that plugs into your cigarette lighter is plenty big enough. The quality of the AC power, not the watts - is the issue. It will work but will not charge as fast as when plugged into AC. The early 18 volt chargers were approx. 30% slower when used with a modified-wave inverter. The newest chargers handle the "square wave" better and can charge 80% to 100% as fast as when on AC. Much depends on the quality of the inverter and the voltage peaks at the tops and bottoms of the waves. Grid power makes 170 volts. Many inverters only make 150 volts at the peaks and dips.
The best way to do it is to buy a DC charger for your gun. Plugs into the cigarette lighter. Just a DC to DC charger. I have one for my Ryobi 18 volt tools.
Dewalt DC9319 DC to DC charger is $75-$80.