Some index funds have a very long horizon before they include them (e.g. a year). Others are "fast-tracked" (e.g. notably VTI). Most of those, however, are float-adjusted, so only the stock available for trade is considered part of the marketcap. So e.g. VTI / VTSAX will buy spacex relatively quickly after the IPO but at the float-adjusted weight of ~$75B because that's the % of stock available.
If you care alot about this, now is the time to understand how your index fund treats IPOs wrt to delays + float adjustment.