sapphi-red / vite-plugin-static-copy

rollup-plugin-copy with dev server support.
MIT License
270 stars 29 forks source link

feature request: .vue file MIME Type support #75

Closed Ahondev closed 8 months ago

Ahondev commented 8 months ago

I need to use copied .vue files in dev, but .vue MIME type is not in the list of MIME types, so it return a MIME type of "", so i'm unable to import it. I get this error:

Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "". Strict MIME type checking is enforced for module scripts per HTML spec.

it seems like in vite-copy-static-copy/dist/index.js, the var mimes didn't contain the key "vue". Maybe consider adding it in the list of supported type with a type of application/javascript

sapphi-red commented 8 months ago

Even if this plugin returned vue files with application/javascript, it won't work. Vue files are not JavaScript files and cannot be executed without transforming to JavaScript. This plugin only copies files without transformation.