Taiwan is having a seriously good trade war. Preliminary data out last week showed growth actually accelerated in the fourth quarter to 3.4%, from 3% in the third. Even better, President Tsai Ing-wen just won re-election by a landslide, giving her a strong mandate to rebalance Taiwan's economy away from China.

Yet that endeavor is easier said than done. Tsai's team still needs to devise a cogent plan to decouple from Asia's biggest trading nation, one determined to quash Taiwan's pro-independence movement.

The good news is that many of the headwinds bedeviling economies around the globe are working in Taipei's favor. One is so-called trade diversion, where Washington's tariffs have caused multinational companies to shift production from China to the island economy.

It is also benefiting from favorable trends, such as respectable global demand for high-end smartphones. Taiwan is enviably suited to ride the wave of new technologies, including the spread of gadgets with fifth generation, or 5G, telecoms capability.

This is not all luck. President Tsai has a knack for confounding the naysayers. Twelve months ago, investors took a dim view of her economic pivot away from China. Just six months ago, political wags assigned low odds to her besting pro-Beijing populist Han Kuo-yu.

Here, Tsai was indeed fortunate that China's Xi Jinping overplayed his hand in Hong Kong. Her big win on January 11 was dramatic proof of the power of Hong Kong's pro-democracy protesters to sway attitudes regarding Beijing around the region.

Yet Taiwan's role as production safe haven also owes much to Tsai's handiwork since 2016. Tsai's revived "New Southbound Policy" of closer ties with Southeast Asia, South Asia, Australia and New Zealand saved the tourism industry. Though the enterprise focused on closer trade and commercial links, it also led to Taipei easing visa curbs and stepping up tourism marketing.

China is highly skilled at limiting travel flows to punish offending governments. Look no further than South Korea in 2017 or Hong Kong more recently. Yet visitor numbers to Taiwan hit a record in 2019, rising 7% from a year earlier.

The government's "Asia Silicon Valley Development Plan" helped inspire Taiwan's most influential businessman, Foxconn's Terry Gou, to prod Apple to shift production to the island. Though Apple has not made up its mind, Gou's vote of confidence was a boon for Tsai's retooling campaign. It is also a reminder that Taiwan's economic future is arguably tied more to advances in iPhones than China.

The government's Asia Silicon Valley Development Plan helped inspire Foxconn's Terry Gou to prod Apple to shift production to the island. © Reuters

Tsai's plan also focused on investment in high-speed internet infrastructure, retaining local talent and recruiting from aboard. It now falls to her to beef up those policies, harnessing the big mandate voters just handed her.

Tsai still has some convincing to do. "We have doubted the success of this investment strategy for several months and are still skeptical of its effectiveness in supporting the Taiwan economy," says Iris Pang of Dutch bank ING.

Such skepticism has no bigger fan than Chinese President Xi, who is presiding over China's slowest economic growth in 30 years. Xi's "Made in China 2025" domestic manufacturing extravaganza has poached more than 3,000 chip engineers from Taiwan. This brain drain dramatizes why Tsai must hit the ground running in her second term.

Tsai has plenty of obstacles: expensive land prices, pricey power, uncompetitive wage scales and the effects of a fast-aging economy. It does not help that the U.S. is a wild card.

A jump in exports of $6.8 billion, or 17.2%, to U.S. President Donald Trump's economy in 2019 overcame a drop of $5.7 billion, or 4.1%, in shipments to China and Hong Kong. But the U.S.'s stabilizing influence relies on Trump resisting the urge to slap new taxes on technology companies or target 5G mobile products beyond Huawei.

Tsai's early response to Trump's mercantilism was to prod China-based Taiwanese companies to invest back home. Chipmakers like Taiwan Semiconductor Manufacturing Co. did just that -- and it paid big dividends for Taipei.

A rising share of exports is coming from companies like Dutch semiconductor equipment maker ASML, the world's largest supplier. Such investments put Taiwan on track for a solid year of foreign direct investment -- a 9% increase in the first nine months of 2019 alone.

Yet the urgency for upgrading Taiwan's economy is rising fast. That includes incentivizing greater innovation and productivity with regulatory and tax tweaks. Tsai's team must accelerate Taiwan's journey up the technology value chain -- from faster semiconductors to biochemical innovation to artificial intelligence.

Economist Min-Hua Chiang of the National University of Singapore recommends relaxing policies for foreign labor. Taiwan is on course to become a "super-aged society" in 2026, with more than 20% of the nation over 65.

Even more important is boosting average compensation. "Low wages will not only drive skilled workers to other countries but also hamper Taiwan's ability to develop innovative, high value-added and knowledge-based industries," Chiang says.

Taiwan is a trade-war winner thanks to its success in avoiding the long-feared "hollowing out" of its tech-heavy economy. Tsai's team must now act boldly to convince investors that Taiwan has a clear and credible plan to overcome the obstacles China will doubtlessly put in its way.

William Pesek is an award-winning Tokyo-based journalist and author of "Japanization: What the World Can Learn from Japan's Lost Decades."