sapphi-red / vite-plugin-static-copy

rollup-plugin-copy with dev server support.
MIT License
287 stars 31 forks source link

Set content-type header from target filename #119

Closed tobz1000 closed 4 months ago

tobz1000 commented 5 months ago

I use the transform function to convert SVGs to PNGs, and to generate json metadata files from script files. When these transformed files are served, the content-type header in the response is for SVG and .ts files (which are interpreted as video/mp2t).

It would be better if the target filename was used on renamed files when determining the content-type to use. Or alternatively, an option to set this header manually.

sapphi-red commented 5 months ago

It would be better if the target filename was used on renamed files when determining the content-type to use.

That makes sense. PR is welcome.