I run my Laravel app locally with Valet (with the secure option with https) on https://example.test
. When I follow the instructions:
npm install webpack-livereload-plugin@1 --save-dev
And put the following in webpack.mix.js
var LiveReloadPlugin = require('webpack-livereload-plugin');
mix.webpackConfig({
plugins: [new LiveReloadPlugin()]
});
And then put this in my Blade file
@env('local')
<script src="http://localhost:35729/livereload.js"></script>
@endenv
And then run npm run watch
(the docs say npx mix watch
but I guess that's the same?) nothing happens. I guess that's because the URL http://localhost:35729/livereload.js
is incorrect? There's nothing in the docs that explains how this works with Valet.
I have also tried the instructions from this answer
Add mix.browserSync('example.test');
to webpack.mix.js
. But when I then npm run watch
it opens localhost:8080
?
Not sure what I need to do to get a live reload to work.