Skip to content

Support for public assets #14

@leoncvlt

Description

@leoncvlt

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions