vue component in Laravel project not update when I deploy to server

Viewed 1548

I'm developing project using vuejs and Laravel. everything worked fine on my laptop and when I upload code to server (Digital Ocean) at that first time.

Otherwise, when I update some Vue component in resources/components folder and upload it to server again. It's seem component is not update on the server when I refresh the browser.

my code in \ webpack.mix.js is

mix.js('resources/js/app.js', 'public/js')
    .sass('resources/sass/app.scss', 'public/css');

if (mix.inProduction()) {
    mix.version();
}

and I try to run npm run dev or npm run prod on the server after I push the nw code on it as well. It doesn't work.

I also try to clear browser cache and reload url again, it doesn't work also.

Please give me an advice how should I do.

Regards.

1 Answers

Well its not a good idea to upload a laravel/vuejs project at shared hosting. Although doing such process can save your life.

  1. Run php artisan serve view:clear
  2. Do changes at your local file and then npm run watch.
  3. after uploading all the changes to server, always replace public/css/app.css & public/js/app.js files.
Related