Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop BrowserSync from reloading multiple times #19

Open
alexanderroidl opened this issue Jan 16, 2022 · 0 comments
Open

Stop BrowserSync from reloading multiple times #19

alexanderroidl opened this issue Jan 16, 2022 · 0 comments
Labels
development enhancement New feature or request

Comments

@alexanderroidl
Copy link
Owner

alexanderroidl commented Jan 16, 2022

BrowserSync's reloading functionality is being triggered several times per file change, approximately 2-3 times per execution. This should be reduced to a single invoke.

// BrowserSync is currently not running
if (!browserSyncRunning) {
browserSync.init(null, {
proxy: `${process.env.WEB_PROTOCOL}://${process.env.HOST_ADDRESS}:${process.env.EXPRESS_PORT}/?debug`,
files: ["build/**/*.*"],
port: process.env.BROWSERSYNC_PORT,
open: false
});
browserSyncRunning = true;
} else {
browserSync.reload();
}

Wheat Farmer BrowserSync screenshot

@alexanderroidl alexanderroidl added bug Something isn't working enhancement New feature or request development and removed bug Something isn't working labels Jan 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant