Strategy Page discusses the historical uses of the submarine in the Pacific and why things would not be the same in the case of a Chinese war:
The U.S. Navy is rethinking how it will use its submarines in a future Pacific War. The problem is that a campaign against Chinese shipping is unlikely, in part because of what actually happened during the last great anti-shipping campaign, which occurred during World War II (1939-45). After the war, the U.S. analyzed its operations against Japanese shipping and found that submarines were important, but not the only weapon effective against shipping. Some 8.9 million tons of Japanese shipping was sunk or so seriously damaged (disabled) at the end of the war. Submarines accounted for 54.7 percent of this. But 16.3 percent was attributable to carrier-based aircraft, 14.5 percent to land- based planes and 9.3 percent to mines (most dropped by B-29s). Less than one percent was due to surface gunfire, and the balance of 4 percent was caused by accidents.
[. . .]
Meanwhile, the U.S. has adopted a new approach to any potential war with China. The U.S. Department of Defense has been told that, for the foreseeable future, there will be no more large-scale land campaigns. The air force, navy, and marines responded with a plan (AirSea Battle) that has been in the work for years. The new strategy is designed to cope with the rising power of China in the Pacific. AirSea Battle involves tighter planning and coordination of navy, marine, and navy forces, plus the development of some new weapons and tactics and cooperation with allies.
[. . .]
AirSea battle concentrates on military operations. But these will be heavily influenced by economic factors. For example, during World War II the United States was a largely self-sufficient “continental power.” We exported much (more than any other nation on the planet), but did not have to import much. That has changed. Now the U.S. has to import a lot of its oil, special raw materials (like “rare earths” from China) and a lot of manufactured goods. The U.S. is now like much of the rest of the world, China included. If there were a maritime blockade of China, the U.S. and many other Chinese trading partners would suffer severe economic disruptions. There would be massive unemployment for all concerned and that would happen despite energetic efforts by everyone to find alternative sources to goods no longer available because of the disruption of the China trade.
[. . .]
Meanwhile, the nuclear submarine community has done the math and found that their greatest contribution these days is not attacking enemy warships, but land bombardment with cruise missiles and intelligence collecting. Since the first nuclear subs showed up in the 1950s, only one, a British boat, has used a torpedo to sink a hostile warship. But hundreds of cruise missiles have been launched at land targets and uncounted (because they are highly classified) intelligence missions have been, and continue to be, carried out. All that is the recent past for subs, and is likely to be the future as well. World War II in the Pacific is not likely to be rerun. The U.S. Navy still expects its subs to go after enemy warships, and its surface and air forces to battle enemy subs. But a major war on shipping is much less likely.