I've commented this a few times recently but enough people have been surprised, I figured I'd make a post.
So,
I set up an 11×11 area with Stakewalls with the four 3×3's in the corner fenced off for animals and crops in the central area. The only two base items I have are a Forge (to repair the Cultivator/Butchers Knife) and a Portal. Jump through the portal, slaughter the animals and while they're breeding back up, harvest and replant your crops. Breeding requires you to be close by but a Piggy or Cub's growth timer works the same way as crops so they'll 'insta-grow' if you haven't been there for a while.
But because there are only two "base items", no raids (with the exception of "You are Being Hunted") can start – but the wolf event can only start in Mountains+ biomes. And even if you're in the Plains, you can repair Stakewall faster than the wolves can destroy it.
Enjoy not having to worry about your crops or 2-star boars/wolves ever again!
Source: https://www.reddit.com/r/valheim/comments/zoke6t/psa_keep_your_farms_and_breeding_areas_a_portal/