DEV Community

jasuke-dev
jasuke-dev

Posted on

Auto reload in laravel using laravel-mix and browserSync

if you want to auto reload the page every time your project file change you can use browserSync

Prerequisite

in this method you must already have laravel project and install and use laravel-mix

Install browserSync and browserSync web[ack plugin

npm install browser-sync browser-sync-webpack-plugin --save-dev
Enter fullscreen mode Exit fullscreen mode

add following code to webpack.mix.js

mix.browserSync('127.0.0.1:8000');
Enter fullscreen mode Exit fullscreen mode

then you can watch your project

watch your project with npm run watch (mix watch)

Top comments (0)