BAC NINH , Vietnam — No country on earth has benefited from President Trump’s trade fight with China more than Vietnam.

The country’s factories have swelled with orders as American tariffs cause companies to reconsider making their products in China. Now, more big technology firms are looking to bulk up their manufacturing operations in Vietnam , lifting the ambitions of a nation already well on its way to becoming a powerhouse maker of smartphones and other high-end gadgets.

First, though, Vietnam needs to get better at making the little plastic casings on your earbuds.

Vu Huu Thang’s company in the northern city of Bac Ninh , Bac Viet Technology, produces small plastic parts for Canon printers, Korg musical instruments, and Samsung cellphones and phone accessories, including earbuds. He said it would be hard for his firm to compete against Chinese suppliers as long as he had to buy 70 to 100 tons of imported plastic material every month, most of it made in China.

“Vietnam cannot compare with China,” Mr. Thang said. “When we buy materials, it’s 5, 10 percent more expensive than China already.” And the Vietnamese market is too small, he said, to entice plastic producers to set up plants here.