1

I am running gulp on a laravel 5.3 and it seems that gulp watch runs and sync via browsersync only once. Whenever I made changes on my scripts, assets are being compiled automatically but the browser doesn't reload.

Here's my gulpfile.js

const elixir = require('laravel-elixir');
const browserSync = require('laravel-elixir-browsersync');

elixir(mix => {
    mix.browserSync({
        proxy: 'local.app'
    });

    // these files are located under [resources/assets/app/css/..] that will be compiled to [public/app/css/...]
    mix.styles([
        '../app/css/bootstrap.min.css',
        '../app/css/animate.css',
        '../app/css/style.css'
    ], 'public/app/css/plugins.min.css');
});

I checked http://localhost:3001/ and everything is enabled on the browserSync settings.

basagabi
  • 4,900
  • 6
  • 38
  • 84

1 Answers1

0

Make sure that local.app is accessible in your browser. Since you are testing on localhost and not on the name: local.app . If that's not the solution you can try this:

mix.browserSync({
   proxy: 'local.app',
   files: ['public/**/*.css', 'resources/**/*']
 });
Christophvh
  • 12,586
  • 7
  • 48
  • 70
  • It's reloading now automatically but the problem is that reloads finishes first before the compilation of assets finishes. Is there a way to make it reload when the asset compilations finishes? – basagabi Mar 03 '17 at 08:21
  • I also notice, my CPU usage is 100%. It seems that it always watches for changes. – basagabi Mar 03 '17 at 08:23
  • Hmm, that seems weird. i personally don't use it since i use Mix instead of Elixir. so not sure what causes that problem – Christophvh Mar 03 '17 at 09:10