When Yahoo! CEO Marissa Mayer re-signed star NBA beat writer Adrian Wojnarowski last year — beating back a spirited attempt by Sports Illustrated to steal him — it was widely reported to be a coup for the Web portal.

But, sources tell The Post, Mayer’s win cost her plenty.

The new contract for Wojnarowski, who has broken too many NBA stories to list here, will pay him as much as $8 million over four years, sources familiar with the situation said.

The new deal, as has been widely reported, will also give Wojnarowski — whose exclusives have become known as #WojBombs — his own hoops-slanted site, The Vertical.

The new site is expected to debut shortly. A podcast began Dec. 16.

Yahoo!’s content plans appear to be going through management consultant McKinsey’s wringer, however, with sources saying many plans are being delayed or in flux.

Yahoo! declined comment and Wojnarowski could not be reached for comment.