There was the related solution here, probably you’ll find some clues there - Vite shadowOnly shaders - #22 by RaananW