I'm trying to use laravel elixir and it works fine.
gulpfile.js:
const elixir = require('laravel-elixir');
require('laravel-elixir-vue-2');
elixir(mix => {
mix.sass('app.scss')
.webpack('app.js');
});
But when I use gulp watch
it watches only for scss
files and not JS
so if I edit app.js
gulp just doesn't compile it however if I run gulp
it compiles everythings it's just gulp watch
that won't work properly.
Maybe (but not sure) problem with webpack
.
So try another way of bundling.
For example try this workaround:
elixir(function(mix) {
mix.scripts(['app.js'], 'public/js/app.js');
.sass('app.scss');
});
Also check terminal what it outputs, maybe some error happening when it tries to bundle app.js
file.
If it will not work, so let's discuss it in comments, because Your problem requires debugging of watcher if it gets event that indicates file changed or not and so on...
maybe OS prevents changing of modification time.
there can be many why-s that prevents that
final recommendation is:
You have to debug "watch" task in gulp and check if it's getting file change event or not. So if NOT - write just Your own task that will check changes and run webpack.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With