How can I run `npm run production`only when the mix-manifest changed?
I am currently running npm run production in my deploy process. However, the build process does take some time and it runs regardless of what is being deployed.
So my question is, how can I run npm run productiononly when the mix-manifest changed?
I don't think you can. How would webpack know if the manifest has changed?
The best you can do is write a node module that saves a copy of the manifest when it's run and do a diff on the current manifest. Or saves a date to a file and checks it against the last updated date of the current manifest.
I don't know that much about weback and all, so the idea of writing a node module sounds pretty dreadful to me.
I am using Laravel Forge though, it does a git pull before running npm run production, so maybe forge should be responsible of finding out if the file is different?