After decades of depending on China, U.S.-based technology companies are now starting to hit the road in search of other places to outsource their manufacturing.

Names such as Google, Nintendo, and Foxconn — which makes electronics for Apple and other tech leaders — have started shifting production out of China and to other parts of the world. Taiwan, Malaysia, Thailand, and Vietnam are some of the countries picking up business.

Part of the reason is President Donald Trump's threat of 25 percent tariffs as Washington and Beijing continue their trade war standoff. But efforts to diversify supply chains — the complex set of companies that make components and final products — have been in effect for some time now.

"Some of this is a long time coming," said Sridhar Tayur, professor of operations management at Carnegie Mellon University's Tepper School of Business. "They have been thinking about it for some time and adding new capacity in other places, so this is less of a sudden shift than you might think."

One reason is the price of operations. China was once seen as the home of cheap labor, compliant workers, and practically non-existent environmental regulations that translated into favorable margins for foreign businesses. The low costs of operations offset such disadvantages as the cost of transportation, length of time it took for goods to arrive, and the increased cost of inventory to keep selling while waiting for a freighter to arrive from China.

That began to change about a decade ago. Non-government organizations began to focus on working conditions, usually at factories creating products for companies like Apple because it was a way to catch attention. Employers began to offer more money and better working conditions to retain workers, which drove up the price of labor.

Activists also focused on environmental issues. Electronics manufacturing can create a lot of pollution. For years, China had been seen as a dumping ground, where weak environmental laws allowed companies to eliminate the costs they would have incurred in their home countries.

"It is becoming more and more difficult to turn a blind eye to worker management as well as the environmental degradation," Tayur said.

Contract manufacturers have also long insisted on business terms and conditions that worked to their advantage and which companies felt pressured to accept.

"A lot of the manufacturers want to lock you in to longer-term agreements and at larger quantities," said Jonathan Eaton, national supply chain leader for Grant Thornton. "U.S. companies often do that at their peril." The problem companies face is the nature of consumer electronics. New models come out "every 12 to 18 months," according to Eaton — or even more rapidly in some cases.

Getting locked in to long-term contracts can mean losing the flexibility to stop production runs on products and move on to new versions. The result can be "excess obsolete inventory that they either have to destroy or sell at a loss." The resulting expense takes a heavy toll on a company's finances.

A third factor is that companies have started to pay more attention to supply chain issues as important parts of strategic decisions and not as a detail left to operations.

"If you talk to most supply chain professionals and leaders, you're starting to see more of these companies have a seat in the C-suite," said Scott Grawe, an associate professor of supply chain management at Iowa State University.

That's pushed the importance of total supply chain costs — including labor, transportation, increased inventory, and even the potential loss of intellectual property that has long been a complaint about China — to prominence.

There is no shortage of countries that want to pick up the extra business. Dell is moving some of its manufacturing to India, which has been looking to expand beyond business service outsourcing. Then there is much of southeast Asia and, in the future, potentially Africa.

However, there are challenges in diversifying electronics supply chains. Other countries haven't had the time to build the collection of factories equipped with the latest types of electronics assembly and automation necessary to win business.

National infrastructures are also an issue. For example, China has invested in port structures and inland waterway transportation. "The ports are deep enough to where they allow the large vessels to be loaded, and they facilitate trade with North America and Europe," said Grawe. Countries without specialized ports that can handle the largest cargo vessels mean shipments may have to be split up, increasing transportation costs.

But such issues are, at worst, temporary. Companies will diversify their supply chains because the turmoil of conflict between the U.S. and China means "business as usual" can no longer be trusted.