Reputation: 501
When I run npm run watch
and update my source .js
and .scss
assets, the compilation is run automatically as expected. When I update the webpack.mix.js
file, the changes are NOT compiled automatically.
Is this something that v6 doesn't support? Because v5 did work as expected.
The config:
const mix = require('laravel-mix')
mix.js('resources/js/app.js', 'public/js')
.sass('resources/css/app.scss', 'public/css')
.version()
package.json
:
{
...
"scripts": {
"development": "mix",
"watch": "mix watch",
"watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "mix watch --hot",
"production": "mix --production"
}
...
}
Upvotes: 3
Views: 4263
Reputation:
Weird, it works for me. Try npm run watch-poll
instead. You should be running the latest version of Laravel Mix:
"laravel-mix": "^6.0.11",
Unrelated, you may want to update your package.json file to the following if you're using Laravel Mix 6.
"scripts": {
"dev": "npm run development",
"development": "mix",
"watch": "mix watch",
"watch-poll": "mix watch -- --watch-options-poll=1000",
"hot": "mix watch --hot",
"prod": "npm run production",
"production": "mix --production"
},
According to the 8.x Laravel documentation...
Webpack may not be able to detect your file changes in certain local development environments. If this is the case on your system, consider using the watch-poll command.
Upvotes: 4