The majority of my (Work in progress) stories ferment in my brain for about a year or two. As a result, the worlds they take place in are mostly thought through and solidified. The only problem I have is that, when writing the story down, I try to go in depth and give the reader the same understanding as me(who has been familiar with it for a while.) and tend to go on really long, boring rants, which leads to me having to go back and edit more than I should have to.
So if you‘re better than me (which is highly likely) and you can just
not do that, then you’ll probably be fine.
I don’t have experience in this so I’m just inferring, but I’d think it’s better to write the story around the world. If you end up thinking through your story and do some world building in your own head after you‘ve already started publishing, you might inadvertently create inconsistencies because you said something that contrasts to your newly imagined world.(which might confuse people.)