app js getting merge conflict when merging branch with master (laravel+vue)

Ignore compiled files in your .gitignore there's no reason to push them to your repository unless you don't have node in your server



Then run

npm install
npm run prod

In your server when you're ready to deploy

Steps to correct

rm public/js/app.js
echo "/public/js/app.js" >> .gitignore
git commit -m "ignore compiled asset"
git push
npm run watch

I usually ignore all compiled assets in public directory


Because it's cleaner and faster to push (since the compiled assets are huge in size +1MB) to have all dependencies in node_modules and write Javascript as ES6 modules in resources/js or formerly resources/assets/js and same for SASS and CSS