Important update!
forget about what I said before, now laravel mix is updated and with some improvements in the functionality and the documentation.
now you can simple:
mix.browserSync('my-domain.dev');
// Or:
mix.browserSync({
proxy: 'my-domain.dev'
})
and then npm run watch
and you are good to go!
if you want to update your webpack version, change the version on the package.json to *:
"laravel-mix": "*",
and run npm update laravel-mix
.
please check the mix updated documentation on github
Important update end
according to the documentation you just need to run npm run hot
on your project and in your script or style-sheet reference use:
<link rel="stylesheet" href="{{ mix('css/app.css') }}">
so the mix()
function will point your assets url to http://localhost:8080/
.
buuuuuuuut... That's just what the documentation say as you can see here. I can't make it work on a laravel fresh install running arch linux, everything compiles as it should and the mix()
function are pointing to 8080
but nothing is injected, I'm back in Ctrl+R
age.
hope you have more luck!