Browsersync reloads my site twice
See original GitHub issue- Laravel Mix Version: 0.11.3
- Node Version: 7.9.0
- NPM Version: 4.2.0
- OS: Windows 10
Description:
Whenever I use mix.browserSync()
my browser gets refreshed twice. Also, If I make a change on my Sass, changes don’t get injected; the browser reloads twice no matter what.
Steps To Reproduce:
This is my webpack.mix.js
:
const { mix } = require('laravel-mix');
mix.options({ processCssUrls: false });
mix.disableNotifications();
mix.setPublicPath('public');
mix.js('resources/assets/js/app.js', 'js')
.js('resources/assets/js/realtime/a.js', 'js/realtime')
.js('resources/assets/js/realtime/b.js', 'js/realtime')
.js('resources/assets/js/realtime/c.js', 'js/realtime');
mix.scripts([
'resources/assets/js/vendor/a.js',
'resources/assets/js/vendor/b.js',
'resources/assets/js/vendor/c.js',
'resources/assets/js/vendor/d.js',
'resources/assets/js/vendor/e.js',
'resources/assets/js/vendor/f.js',
'resources/assets/js/vendor/g.js',
'resources/assets/js/general.js'
], 'public/js/all.js');
mix.less('node_modules/spectre.css/spectre.less', 'css/vendor.css');
mix.sass('resources/assets/sass/main.scss', 'css')
.sass('resources/assets/sass/realtime/a.scss', 'css/realtime')
.sass('resources/assets/sass/realtime/b.scss', 'css/realtime')
.sass('resources/assets/sass/realtime/c.scss', 'css/realtime');
if (mix.config.inProduction) {
mix.version();
} else {
mix.browserSync({
proxy: 'app.dev',
// I also tried this: files: 'public/**/*'
});
}
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Browsersync reloads my site twice · Issue #789 · laravel-mix ...
Whenever I use mix.browserSync() my browser gets refreshed twice. Also, If I make a change on my Sass, changes don't get injected; the...
Read more >Error You tried to start Browsersync twice - Stack Overflow
I'm trying to set up browsersync within my gulp file but keep getting this error "[error] You tried to start Browsersync twice!".
Read more >BrowserSync start twice? (gulp) : r/webdev - Reddit
I started to work with BrowserSync (with gulp) and at first everything ... Startup the server in another task and reload it with...
Read more >Browsersync options
Browsersync makes your browser testing workflow faster by synchronising URLs, interactions and code changes across multiple devices.
Read more >Gulp from Scratch: Browser-Sync Stream changes ... - YouTube
Gulp from Scratch: Browser-Sync Stream changes without Reload ... Designer: http://bit.ly/1X7CrDA :: My Website :: http://www.alecaddd.com/ ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah, I figured out my issue. I was watching the
/src/**
files instead of the compiled files in/public/{whatever}
, so the changes weren’t there until next save. Makes sense. Silly me.I have found final result should be like