What does scripts "npm run dev" and "npm run watch" is used for?
Technically those will just run whatever scripts are defined in your
package.json with the name
watch. Without seeing your
package.json it's impossible to know exactly what they do.
dev command will compile the code then exit while the
watch command will compile the components then watch the files and recompile when one of them changes.
npm run watch does the same, but then it stays active and "watches" for updates to your
.js files. If it detects a change, it'll re-build the browser-friendly file so you can just refresh the page.