The roughly $1 trillion infrastructure package passed by Congress on Friday provides a spark to efforts to build a national network of electric-vehicle charging stations.

The bipartisan measure touches on nearly every aspect of the electric-vehicle industry and eclipses previous efforts in the U.S. It also includes funding to help transform the nation’s aging electric grid by upgrading high-voltage transmission lines and other infrastructure set to become even more crucial as the country electrifies more of its transportation system.

It directs $5 billion to expanding electric-vehicle highway charging, which once in place would let drivers take longer road trips without the fear of running out of power. Proponents consider long-distance charging networks a critical missing ingredient for wider adoption of EVs.

A further $2.5 billion in federal grant funding could go toward electric-vehicle charging or alternatives such as hydrogen-fueling infrastructure, while $2.5 billion is set aside for electrifying school buses. Even more money for EVs could come through a separate $2.5 billion for low-emissions school buses, or measures such as $2.25 billion for ports that could be tapped for electrification projects.

“These are big, big numbers relative to what’s happened in the United States,” said Nick Nigro, founder of Atlas Public Policy, a Washington, D.C., research firm that tracks the EV market. “This is transformational for electric vehicles.”

So far, less than $5 billion has been committed to electric-vehicle charging infrastructure collectively in the U.S. by government agencies, utilities and states, and that has happened over a period of many years, Mr. Nigro said.

While the funding represents an unprecedented level of government support for electrifying transportation, analysts say far greater sums would be needed to build a national network of charging stations akin to the gasoline stations that now dot the country. Government officials hope to build a more robust network of chargers capable of powering all types of electric vehicles. Currently, one of the most expansive networks in the country is the one Tesla Inc. TSLA -0.64% built to support its vehicles.

Many electric-vehicle charging stations are unprofitable, and the burgeoning EV industry faces a chicken-or-the-egg dilemma: Consumers are wary of buying electric vehicles without sufficient stations, and companies are reluctant to build stations without sufficient customers.

‘This is transformational for electric vehicles.’

— Nick Nigro, founder of research firm Atlas Public Policy

Auto makers have started to offer more electric-vehicle options, and the U.S. is beginning to develop the ecosystem for a large build-out of charging stations, but the efforts remain a work in progress. States have established grant programs, and many utilities offer programs to get infrastructure in place. Convenience stores have started to sample the business, though many don’t view the market as viable yet.

“States are prepared. They’ve got experience,” said Anne Smart, vice president of public policy at the charging provider ChargePoint Holdings Inc. CHPT 0.41% The charging industry has a network of contractors and “people in all 50 states ready to install the stations and maintain the stations,” Ms. Smart said.