-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[systemjs] new URL
question
#10842
Comments
I don't understand what exactly is the issue of using |
Indeed, within a single application it works fine. This problem exists when using the
<script setup lang="ts">
const vueLogo = new URL('./assets/vue.svg', import.meta.url);
</script>
<template>
<img :src="vueLogo" class="logo vue" alt="Vue logo" />
</template> <script setup lang="ts">
// it works
const currentUrl = new URL('', import.meta.url);
const viteLogo = new URL('/vite.svg', currentUrl.origin + currentUrl.pathname);
// it is not working
const vueLogo = new URL('./assets/vue.svg', import.meta.url).href;</script>
<template>
<div>
<a href="https://vitejs.dev" target="_blank">
<img :src="viteLogo" class="logo" alt="Vite logo" />
</a>
<a href="https://vuejs.org/" target="_blank">
<img :src="vueLogo" class="logo vue" alt="Vue logo" />
</a>
</div>
</template> |
I have also the same issue and I think, that it should be possible to requests media assets from the same origin as the js files. I remember in an early version of Vite there was the same discussion with the javascript assets. It did not work with js files either. So I wonder, why there was the decision to transform |
IIRC we use |
Describe the bug
When I upgraded from 3.04 to 3.2.2, the
new URL('../assets/imgs/logo.svg', import.meta.url).href
code did not work properly under the micro frontend system, after analysis Found that version 3.2.2 ofvite
willimport.meta.url
->self.location
.Reproduction
https://stackblitz.com/edit/vitejs-vite-vf9tp2?file=apps/vitte-app/src/App.vue
Steps to reproduce
pnpm i
pnpm dev
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: