Do workbenches and other base structures prevent Raid enemies spawning?

Most of the playerbase knows that workbenches and other base structures stop mobs from spawning in their radius, I'm thinking about putting these around my spiked walled area so everything spawns outside the wall. But this area is pretty big so at the moment enemies and raids spawn inside, i live in an island, the markers are where the gates of the walls are, so putting the workbenches would really help me build animal pens, other houses, etc. Problem is the raids. For now I have not defeated the Elder so the Troll raid is an issue for the future, but it worries me.

If I go through with the workbenches and stuff, will the raid mobs also spawn outside or will they spawn inside my walls?

https://preview.redd.it/9mi4qc8uqqua1.jpg?width=1360&format=pjpg&auto=webp&s=bc7257e766502895e7781bf14768473210fdcc5c