Skip to content
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

How to use dynamic imports with Vite? #93

Closed
retroriff opened this issue Aug 27, 2022 · 1 comment
Closed

How to use dynamic imports with Vite? #93

retroriff opened this issue Aug 27, 2022 · 1 comment

Comments

@retroriff
Copy link

On Vite require doesn't work because it's webpack-only.

<template>
  <div v-html="require(`../assets/${name}.svg?raw`)" />
</template>

<script>
  export default {
    props: {
      name: { type: String, default: "image" },
    },
  };
</script>

Is there any alternative for Vite?

@manuelodelain
Copy link
Collaborator

Duplicate of #86

@manuelodelain manuelodelain marked this as a duplicate of #86 Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants