The most common shadow technique “shadow mapping” does not work with environmental lighting since there is no position in 3D space from where you can generate a shadow map. That is however possible with punctual lights like spot, directional and point lights.
I imagine this would work with a path-tracer like Blender’s Cycles renderer. I’m not sure how it could be done in a realtime rasterizer like Blender’s Eevee, or THREE.WebGLRenderer.