Open smcenlly opened 1 year ago
The transform test code:
transform
https://github.com/wheatjs/vite-plugin-vue-type-imports/blob/8de15f91cbab7672848a43bb0e68a4cd20c739dd/src/vite.ts#L15
expects the file to end in .vue. This may/may not be the case depending on upstream transformations.
.vue
Specifically, some other vue plugins can append querystring suffix on the files and then this transform fails to run resulting in errors.
For example, the filename may be:
/components/TheHeader/TheHeader.vue?vue&type=style&index=0&scoped=0d34c1b2&lang.scss
or, in the case of our plugin, it was:
/components/TheHeader/TheHeader.vue?ts=123456
I have this problem using Vitest Browser, rn we need to bypass browser cache adding a timestamp (xxx.vue?v=<random>), and so this plugin just does nothing.
xxx.vue?v=<random>
The
transform
test code:https://github.com/wheatjs/vite-plugin-vue-type-imports/blob/8de15f91cbab7672848a43bb0e68a4cd20c739dd/src/vite.ts#L15
expects the file to end in
.vue
. This may/may not be the case depending on upstream transformations.Specifically, some other vue plugins can append querystring suffix on the files and then this transform fails to run resulting in errors.
For example, the filename may be:
or, in the case of our plugin, it was: