fandogh / laravel-multimix

Laravel-Mix helper for projects with complex & multi assets.
https://fandogh.github.io/laravel-multimix
MIT License
26 stars 2 forks source link

Reload watcher when webpack.mix.js file is udpdated #1

Closed anewage closed 7 years ago

anewage commented 7 years ago

Not sure if this is a relative issue, but there isn't so much of a change when the webpack.mix.js file is updated while the run watch <package name> is executing (changes in the webpack file are of course in the scope of the requested package!). So you have to stop the execution of that command, make the changes to webpack file and run it again to see the changes.

Again, not sure if this is an appropriate question or the webpack is technically not meant to change or update during watch operation.

pi0 commented 7 years ago

Hey @anewage to achive this you can install nodemon : npm install -g nodemon Then watch for changes: nodemon --watch webpack.mix.js node_modules/.bin/laravel-multimix watch

This can also be easily added to workflow by:

the94air commented 6 years ago

For some reason nodemon didn't work until I removed the last watch. Thanks @pi0

"scripts": {
    "mix": "nodemon --watch webpack.mix.js node_modules/.bin/laravel-multimix"
}

Update 1/3/2018 @pi0 script is working on Windows but mine is working on Ubuntu.