Questions tagged [gulp-browser-sync]

148 questions
0
votes
0 answers

brower-sync via gulp file does not reload although browserSync.reload is wired to on('change')

I serve a site in development via browser-sync and have tried to wire up the sub-directories, so that the browser on files changes reloads. -- However the browser does not reload when I kick of the server with $ gulp serve and load the site in a…
halloleo
  • 9,216
  • 13
  • 64
  • 122
0
votes
1 answer

Browsersync not reloading since updating to gulp-sass 5.0

Browsersync not reloading after each style/gulp-sass task. The issue started since updating Gulp. Here is the Gulpfile.js. It used to work when gulp-sass has a default Sass compiler. const sass = require('gulp-sass')(require('sass')); const gulp =…
0
votes
1 answer

Is there a way to have Browsersynch on gulp watch my WP php files?

So I downloaded this Worpress template with gulp and browsersynch which watches all .js files and .css files. The wierd thing is that whenever I want to use gulp and BroswerSynch I have to type npm run watch So what I am trying to add on my gulp…
0
votes
0 answers

window.location.href and startsWith

I have the following JavaScript running in Chrome (demo only) var url = window.location.href; console.log(url + ": " + url.startsWith('http://127.0.0.1')); If the url is http://127.0.0.1 and the startsWith returns true as expected. However, if the…
curious1
  • 14,155
  • 37
  • 130
  • 231
0
votes
1 answer

Browser-sync not opening index.php (using Gulp)

I am having an issue where browsersync does not find/open my index.php file. The relevant parts of my gulp file are as follows: const browserSync = require("browser-sync").create(); const php = require('gulp-connect-php'); // Configure PHP…
luke.mas
  • 2,335
  • 1
  • 6
  • 12
0
votes
1 answer

How to get Browser-Sync to serve PHP-Files in Gulp 4

I am working on a gulpfile which already works fine when its processing html/scss/js. Now I want to have my site on PHP-basis and need Browser-Sync to serve my PHP instead of showing "Cannot GET /" in the browser. I know that implies some path issue…
0
votes
0 answers

Can't edit styles in Chrome Dev Tools while using Browser-sync

I use the latest Chrome version on Mac (83.0.4103.116), Gulp + Browser-sync. In DevTools, after the Browser-sync applies the changes in style.css and reloads the page, I can't edit any style, it looks like default and blocked: screenshot It's very…
0
votes
0 answers

browser-sync does not refresh the page from gulp

browser-sync used with gulp does not refresh the page in the browser even for a simple setup. Versions: gulp: 4.0.2, browser-sync: 2.26.7, Chrome: 81.0.4044.138 Folder structure: |- src/ |- index.html |- dist gulpfile.js: const { task, src,…
0
votes
1 answer

How to create a simple html live reload with gulp and browser-sync

I'm new to using Gulp (especially Gulp 4) and to start of I just want to have a very basic live reload on any changes in my index.html file (in the root folder). So far I have this: var gulp = require("gulp"), browserSync =…
0
votes
2 answers

Problem with HTML reload with TailwindCSS and Gulp

I'm setting up a project with TailwindCSS. I'm trying to set up my automation with Gulp, but I'm running into an issue with the HTML reloading. Everything seems to work perfectly fine when I run Gulp, it minifies and cleans my CSS, concats and…
CV94
  • 1
  • 1
0
votes
1 answer

BrowserSync loads different root directory on two computers with the same code

There is one project in Git repository and there are 2 computers that both pulled the latest version of the source code. So they run exactly the same code. I use gulp together with the BrowserSync npm module and I pass only one…
Tacud
  • 609
  • 5
  • 16
0
votes
0 answers

How can I use PHP with MDBootstrap (Pro) and Gulp 4?

Quite new to Gulp and would like to integrate PHP includes using MDBootstrap. Here is part of my gulpfile.js if that helps any... // Live Server gulp.task('live-server', function(done) { console.log("Restarting server..."); …
infin80
  • 1,343
  • 1
  • 9
  • 10
0
votes
1 answer

Browser-sync, scripts and styles reload not working when migrating from gulp 3.x to gulp 4.x

I am trying to upgrade gulp from 3.x to 4.x When using gulp watch, the styles, scripts and inject function works well.But when I make any file changes the scripts and styles need to be loaded automatically. This is not working. I have tried adding…
Ragini
  • 13
  • 3
0
votes
0 answers

Can't get chrome to launch, using browser-sync

I have successfully written this code and it executes in bash, but doesn't launch the browser. Any help is appreciated. Both the commented out code and the uncommented launch in bash fine, but I never get chrome to open my html file. How do get…
0
votes
1 answer

use browserSync.stream() after other task

When I use the stream() method like this it works well: var gulp = require('gulp'), watch = require('gulp-watch'), browserSync = require('browser-sync').create(); gulp.task('watch', function () { browserSync.init({ notify:…
o-sapov
  • 320
  • 2
  • 13