Tree-shaking with Vite seems to work great out of the box even when importing 'examples'-folder modules. I've tested it with the currently latest tree-version (127) only, but will also test older releases.
Feel free to star / leave a comment if you would like to see this released as an npm package.