In the end fuel costs money so more efficient logistics is often good for the environment. Buying local makes a lot more sense if you live in a farming community than a port city.
This is where the last mile problem comes in. https://en.wikipedia.org/wiki/Last_mile_(transportation)
Now, growing enough of one thing to be able to sell it to turn a profit might have "greater externality" but even that might not be true depending on the methods used. There are composting farms where people bring their refuse - specifically "anything that was alive recently" can go in the compost, and this will provide nutrients and soil amendments in a sustainable way to that farm, which can then provide nutrition to the community it serves.
You can't feed the planet with a small, self-sustaining farm. But this idea that it's a net negative needs to DIAF.
It entirely depends on how many externalities are created as debt to the future in order to ship blueberries around the world. Internalize those externalities and the grinding force of the market will eventually eliminate or mitigate them.
The future we should all be striving for is one of extreme abundance for everyone, not forcing everyone into hair shirts.
Look at the price to ship something.
The cost of fuel burned can not be greater than the shipping cost, and it is probably much less.
* the cost of cleaning up all the carbon we’ve spewed out
* the cost of fossil fuel subsidies
* the political cost of doing business with oil producing countries, many of which seem to be fairly hostile