Search code examples
netlifyvite

Vite app not rendered properly on Netlify


Is there any environment variable to set up for my Vite app deployed on Netlify. When I use npm run dev on localhost, my site is rendered as expected, but when I use the same build command on Netlify, it just renders the pure HTML page without using the Vite main.js. I include my link to my project here: https://github.com/nguyenvothuan/Portfolio/tree/master and to netlify: https://quizzical-jepsen-e78ac7.netlify.app/


Solution

  • Update: Set the following:
    build command: npm run build (not npm run dev)
    publish directory: dist