The pandemic had a bright silver lining for Elkhart, Ind.

The city, renowned as the capital of recreational vehicle production, had a surge in demand as cooped-up families took to the highways and avoided hotels. The cluster of manufacturers enjoyed record profits, and workers benefited as well: The metropolitan area’s unemployment rate sank to 1 percent in late 2021, and average weekly wages jumped 35 percent from their level in early 2020.

That frenzy, however, has turned to a chill. Dealers, who stocked up on as many trailers and vans as they could, have been discounting them to clear their lots — and new orders have dried up. The area has lost nearly 7,000 manufacturing jobs over the past year, and unemployment is now above the national average. Thor Industries, which owns a wide portfolio of RV brands, saw its sales tumble 39.4 percent from the quarter a year ago.

“In 2022, manufacturers overproduced, and you’re seeing some of the impact of that from the staffing standpoint,” said Chris Stager, chief executive of the Economic Development Corporation of Elkhart County. He foresees new projects propelled by recent federal energy and infrastructure legislation, but rising interest rates are taking a toll in the meantime.

“It’s not bad, but it’s not what it was,” Mr. Stager said.

That’s manufacturing in America in 2023.

Factory construction is proceeding more rapidly than at any time in recent memory, heralding what may be a resurgence in domestic production powered by a move away from long, fragile supply chains and by the infusion of billions of dollars in public investment.

At the same time, after an extraordinary boom fed by cooped-up consumers, manufacturing is suffering something of a hangover as retailers burn through bloated inventories. Inflation-fighting efforts by the Federal Reserve, which is expected to announce another interest-rate increase on Wednesday, have squelched big-ticket purchases. New orders have been declining since last summer, and a widely followed index of purchasing activity has been downbeat for six months.

Manufacturing employment bounced back quickly after the pandemic — which is unusual for recessions — but has contracted for two months. While layoffs in the industry remain low, job openings and hires have sunk from recent highs.

“It’s not one of these really concerning plunges, where we’re shedding a bunch of manufacturing jobs, but it seems kind of stalled,” said Scott Paul, president of the Alliance for American Manufacturing. “And I think the longer that lasts, the harder it’s going to be to rev things up.”

A bigger question for the American economy is whether this heralds a broader downturn, since cooling demand for goods usually signifies that consumers are feeling financially strained. “Manufacturing is always at the forefront of the recession,” notes Barbara Denham, a senior economist at Oxford Economics.

To understand the current slump, it’s important to dissect the manufacturing moment from which America is emerging.

For example: Those new manufacturing jobs weren’t all for people making steel coils and oak cabinets. The production of consumable items — including food, beverages, and pharmaceuticals — represented an outsize portion of the job growth from 2020 through 2022. But it tends to pay less well, requires less training and has fewer unions than heavy manufacturing in airplanes and automobiles. And it can disappear more quickly as demand returns to normal.

The pandemic-era manufacturing boom also didn’t happen equally in all places. States like Nevada, Arizona, Florida and Texas surged far above their prepandemic baselines, while longtime manufacturing centers — Michigan, Illinois, New York and Ohio — have not fully bounced back. That imbalance reflects recent migration trends, as people have moved out of urban areas for more space, more sunshine and a lower cost of living.

The factory construction underway is poised to further reshape the geography of American manufacturing, with the largest increases in investment happening in the Mountain West.

All that new building is propelled by several factors. Former President Donald J. Trump’s trade war raised the cost of importing from China and other countries, while the pandemic snarled ports and idled suppliers, hurting manufacturers who depended on far-flung sourcing networks.

In recent months, the war in Ukraine — for which the United States has furnished more than $36 billion in weaponry — has generated more long-term contracts for defense manufacturers, mostly restricted to domestic production.

Steve Macias, a co-owner of a small machine shop in Phoenix, said orders from the semiconductor industry have slowed as the demand for home electronics crested. But in the past few weeks, he has been busy serving military clients — because the Defense Department has been getting planes and ships back into fighting shape, as well as refilling empty stores of munitions.

“There was a lot of deferred maintenance,” Mr. Macias said. “So you’ve got two things going on — this kind of catch-up, and this war that broke out that nobody was really anticipating.”

Finally, over the last two years the passage of three major bills — the Infrastructure Investment and Jobs Act, the Inflation Reduction Act and the CHIPS and Science Act — made available hundreds of billions of dollars for the production of items like semiconductors, solar panels, wind turbines and bridge spans. Private funders have rushed to capitalize on the opportunity, even if much of it is still in the planning stages.

“A lot of manufacturers are reacting to what they see as a lot of long-term structural factors in their industry,” said Adam Ozimek, chief economist at the Economic Innovation Group, an entrepreneurship-focused think tank. “They’re seeing more demand for domestic production long term. That’s a bet on the future. It’s going to take a while to really translate to employment.”

Even when it does, however, that investment might not yield as many jobs as factories with similar levels of output did in the past.

Freshly built production lines tend to be more automated and more efficient than those designed in the 1950s and ’60s — which they need to be, to compete with the lower cost of labor overseas. And some companies are adding robots to their plants, given the difficulty of attracting and retaining enough skilled workers to replace those retiring. The median age of workers in manufacturing is two years older than the national median.

“These facilities are desperate to try to get the work force,” said Mark Farris, chief executive of the Greenville Area Development Corporation in Greenville, S.C. “And instead, I think they’re convincing the officers of the company, ‘Let’s think about robotics, let’s think about 3-D printing, the technology investment that would take the place of those workers we cannot find.’”

For businesses that depend on industries related to fossil fuels, the ramp-up in federal investment may just be enough to keep them afloat even as demand shifts to clean energy.

LaDon Byars runs Colonial Diversified Polymer Products, which employs about 75 people in western Tennessee. The company has survived many cycles of outsourcing and offshoring, making molded rubber products like gaskets and mats for a variety of customers. Automobile manufacturers are important clients, and Ms. Byars knows that demand for parts that go into cars with internal combustion engines will start to wane.

She has been encouraged, however, by the number of solicitations she has received as a result of rules that require federally funded projects to find their parts and raw materials in the United States, rather than overseas. It may be difficult and impede progress at first, but she thinks reinforcing domestic supply chains will work out better in the end, just like building new roads.

“It takes a while before they get that intersection through — it’s a mess and traffic is backed up,” Ms. Byars said. “And then when they finally open it up, everything works so much smoother and better, and you don’t have the long delays. We might not even see the impact of not being dependent on other countries, and not having the supply chain disruptions, but I do think that’s what the long-term best interest for the American people is.”