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.
Specifically, I do a typical 3FP and own VTSAX, but I don't read bogleheads or anything. True set-it-and-forget-it, but I do want to read more if things are shifting.
VTSAX (and VTI) follow the CRSP index. This is float-adjusted but they likely will be fast tracked (these are two separate rules in how this index chooses to weight things and participate in new stocks). At ~5% float, these companies will be in the 50-100B range. So under all those assumptions, they'll be bought quickly but represent less than 1% of VTSAX (until they float more shares on the public market).