Problem with biomes namespace

I have a datapack that modifies the loottable of the standard bonus chest so that the loot in it depends on the biome, but at 1.21 I ran into a problem. Previously, before 1.21 loottable worked even if it contained biomes from unused datapacks or mods, now it simply does not load with error about this biomes. The only solution to this, it seems to me, is to make versions where only vanilla biomes are present, or terralith + vanilla biomes. But I would like to know if it is possible to somehow use pack mcmeta to determine which datapacks are loaded, and based on this, use a specific folder inside one datapack? In order not to make a large number of different versions of datapacks, but to put everything in 1 zip file.
Continue to help post