[Vuejs]-How to update the dist folder of Vue js without running npm run build a second time

1👍

You can run vite build --watch that will be updating constantly while updating your vue files. In package.json I’ve added a script "updater":"vite build --watch" in scripts
and to deploy it to github constantly (as git commit doesn’t work with me) so I created push.js in the ./ (root) dir and used var ghpages = require('gh-pages');ghpages.publish('dist', function(err) {}); in push.js
and I hope this helps you and works with you too
and again in package.json I’ve added a script
"push" : "node push.js"

0👍

Initialize the dist folder for a git repository where u host yr deployment for the final build. Then push the dist contents to the remote repo and then next time u make a deployment then since the dist folder is initialized for git when u push the dist contents it then updates the remote repo contents

assuming you are in project folder e.g my project

cd dist
git init 
git remote add origin <remote repo URL>
git push -u origin <branch-name>

Then do what you do (making changes to the project and run again npm run build
Then push again, changes in the remote repo will be available and u can pull the new contents and deploy. Hope this helps.

Leave a comment