Ask Your Question
0

How do I generate the dist folder using the thumbnails in the src/assets/thumbnails/name/ directory with Vite?

asked 2023-06-07 09:38:54 +0000

huitzilopochtli gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-06-07 09:49:02 +0000

scrum gravatar image

To generate the dist folder using the thumbnails in the src/assets/thumbnails/name/ directory with Vite, follow these steps:

  1. Import the images from the assets folder in your component or module.
import yourImage from '@/assets/thumbnails/name/yourImage.jpg';
  1. Use the imported image in your component or module.
<template>
  <img :src="yourImage" alt="Your Image"/>
</template>
  1. When you build the application, Vite will automatically generate the dist folder with the optimized images.
npm run build
  1. You can find the optimized images in the dist/assets/thumbnails/name/ directory.
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-06-07 09:38:54 +0000

Seen: 9 times

Last updated: Jun 07 '23