If so how was it imported.
And when did they become self-sufficient if they were not at the start of the war?
In December 1775, there was a major shortage of gunpowder in the continental army. To combat this, the continental army freely spread the "recipe" to create gunpowder among their supporters and began to encourage domestic manufacture, which largely didn't exist before the war. Between 1775 and 1777, they were able to produce 100,000 pounds of gunpowder domestically. France began supplying the colonial army with gun powder near the end of 1776 and continued to do so throughout the remainder of the war. France was able to supply the colonists with 1,000,000 pounds in this amount of time.
I drew my information from the following article. It's a description manuscripts that gave instructions on how to produce gun powder during the revolutionary war.