Search code examples
vuejs3vitenetlify

video issue building vue project with vite


I built my portfolio website with vite & vue3 and hosted it on Netlify, now I have an issue with my website I have a project page with a video of the project, and the videos are stored in '/assets/works/example.mp4' but when I build it using 'npm run build' the videos not showing up in the 'dist' folder. I will be glad to hear a solution or another approach.

playing with vite config and make the videos appear in the dist folder.


Solution

  • You need to add your .mp4 in your public directory, then it will copy in your dist directory. the public folder is served on / so you can now access your file with /path/to/your/.mp4/under/public/directory.

    Public directory