vite-plugin-vue2
vite-plugin-vue2 copied to clipboard
`template.transformAssetUrlsOptions.includeAbsolute: false` has no effect.
This is the same issue as https://github.com/vitejs/vite/issues/4836 that was fixed by https://github.com/vitejs/vite/pull/6779 for Vue3.
The following configuration has no effect because it gets overwritten here:
createVuePlugin({
template: {
transformAssetUrlsOptions: {
includeAbsolute: false,
},
},
}),
I have the same issue. Did you come up with a workaround @ascott18 ?
I've got the same issue incorporating Vue 2.7 with Laravel, it's causing import errors on the absolute assets processed by vite. It's tossing me a console-level error complaining about importing a different MIMEtype as JavaScript.
Unless @ascott18 has a work-around, it might be worth looking into crafting a PR that fixes said issue.
I've created PR #48 which basically applies the fix for the Vue3 plugin (switching the object unpacking around so user settings override the defaults instead of the other way around)
If completely disabling asset transformation will work for your app, then you can do that ({ template: { transformAssetUrls: false, }, }), but beyond that I don't know of a workaround.
For Laravel devs who run into this issue despite having the newest version of the plugin - try transformAssetUrlsOptions: {...} instead of transformAssetUrls: {...}. The latter is from current Laravel docs, I guess it's for the Vue 3 plugin or something.
For Laravel devs who run into this issue despite having the newest version of the plugin - try
transformAssetUrlsOptions: {...}instead oftransformAssetUrls: {...}. The latter is from current Laravel docs, I guess it's for the Vue 3 plugin or something.
@rafalglowacz worked fine for me. thanks
Para los desarrolladores de Laravel que se encuentran con este problema a pesar de tener la versión más reciente del complemento, intente
transformAssetUrlsOptions: {...}en lugar detransformAssetUrls: {...}. Este último es de los documentos actuales de Laravel, supongo que es para el complemento Vue 3 o algo así.
Muchas Gracias 🇨🇴 🙏 @rafalglowacz