My app includes a dozen or so image files. Some of these are merged into the /assets/index-?????.js
file (as I would expect), others are not and are put into the /assets
folder separately (with name-mangling).
Here is the build ouput:
vite v4.1.4 building for production...
✓ 436 modules transformed.
dist/index.html 0.43 kB
dist/assets/notrack-6b2c347b.jpg 4.42 kB
dist/assets/topright-3d03ad17.png 4.72 kB
dist/assets/holder-f1d73545.jpg 8.21 kB
dist/assets/noentry-492af733.jpg 9.71 kB
dist/assets/index-8c326570.css 401.51 kB │ gzip: 50.54 kB
dist/assets/index-da5aa7cc.js 377.53 kB │ gzip: 129.16 kB
Those four image file are not differently used / defined as the other 10, which have been merged into index-da5aa7cc.js
. All the images are defined thus:
const botright = new URL('./assets/images/botright.png', import.meta.url).href
and I have also tried
import botright from './assets/images/botright.png'
which gives the same results. I have read this thread but it hasn't helped.
All of the images are used in the same way:
<v-img class="cannotDrag"
@dragstart="drag($event)"
:src = cell.content
>
</v-img>
The package all works OK in the browser, but I am curious as to why not all image files are treated the same way. It's not as if these four images are the first 4 (or the last 4) to be defined, or that some are .png
and the others are .jpg
(I also tried changing them all to .png
but got a very similar result).