-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Great plugin! In most of my projects, however, I tend to store the 3D models in the public folder, which of course results in the plugin not picking up the files for optimization.
I quickly created a proof of concept which works on those public assets - it consists of hookin up the closeBundle plugin function to recursively iterate through all files inside the viteConfig.build.outDir folder, then filtering gltfs/glbs out and running the same transform functions, overwriting the files.
It should be pretty easy to generalize the asset processing function in the plugin and have a flag in the plugins config to run that on load (for bundled assets) or on closeBundle (for public assets).
@donmccurdy would such functionality be in the plugin's scope? If so, I'll start working towards a pull request.