How to exclude unused assets from build?

Hello, is there a way to exclude unused assets from build on packaging stage without remove assets from Content folder?