browser-sync

Using browser-sync with node.js app

ぃ、小莉子 提交于 2019-12-19 07:23:34
问题 I have an existing node app. My Node directory structure is setup like this: ./ node_modules/ src/ views/ index.html ... server.js test/ gulpfile.js package.json I can successfully start my app my running node ./src/server.js from the root shown above. Once started, I can visit "http://localhost:3000" in the browser and see the contents of index.html like I am expecting. I want to speed up my development and I recently learned about browsersync. In an attempt to include it in my gulp process,

BrowserSync extremely slow

China☆狼群 提交于 2019-12-17 22:18:54
问题 I would love to use BrowserSync for development. However, page loading (not only reloading after changes) is extremely slow. I use the proxy mode. Browsing the page without BrowserSync is fast as it should be. One reason may be the following error when I install BrowserSync: > ws@0.4.31 install /usr/local/lib/node_modules/browser-sync/node_modules/socket.io/node_modules/engine.io/node_modules/ws > (node-gyp rebuild 2> builderror.log) || (exit 0) CXX(target) Release/obj.target/bufferutil/src

Nodejs - BrowserSync running on express server

送分小仙女□ 提交于 2019-12-14 04:22:59
问题 I want to pull a URL from the DB and use it as the proxied URL. However the setup I've come up with initializes a new BrowserSync server for each URL, using incrementing port numbers. Is there a way to accomplish this without initializing a new BrowserSync server every time? Or should I be using another approach? var bs = require("browser-sync"); var express = require("express"); var router = express.Router(); var app = express(); router.get("/", function(req, res){ var proxyUrl = getUrl() /

Gulp BrowserSync showing “reloading browsers” in Terminal, but not reloading the actual browser.

删除回忆录丶 提交于 2019-12-14 03:55:07
问题 I'm having an issue where my tasks are running as desired and BrowserSync seems to be working, but the actual browser isn't reloading. I'm getting the right messages in my Terminal to suggest everything is working as planned. I'm using MAMP for my local server which is serving a Wordpress build. I'm using Chrome v65 on a Mac. My gulpfile is below with a screenshot of my Terminal. Any ideas what might be causing this issue? // ===================================================================

BrowserSync + Gulp with Vagrant not refreshing

我们两清 提交于 2019-12-13 12:50:42
问题 I'm using BrowserSync with Gulp to live reload a site in a local machine when specific kinds of files are changed. I've the following snippet in my gulpfile : gulp.task('browser-sync', function() { browsersync.init({ proxy: "mySite:8080", files: ["./*.html", "dev/*.css"] }); }); When changing (and saving) any of the above kinds of files, I get an output like this in my terminal: [BS] Serving files from: ./ [BS] Watching files... [BS] File changed: index.html [BS] File changed: dev\styles.css

How to sync the actions performed on webpage using Browsersync?

旧巷老猫 提交于 2019-12-13 08:41:05
问题 I am an automation tester. I installed browser-sync globally to test the website we have. I tried with below code (in index.html file) for trial purpose. <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="css/style.css"> </head> <body> <iframe src="https://www.google.co.in/" onload="this.width=screen.width;this.height=screen.height"></iframe> </body> </html> I had added an iframe to open the URL I want to open and resize it to default windows size. And CSS code call above is as below:

BrowserSync Gulp doesn't open in Chrome

ぐ巨炮叔叔 提交于 2019-12-13 02:46:01
问题 I try to open my website on localhost using BrowserSync and Gulp in Chrome, but it doesn't work. Default, it open in Firefox and everything works well. But, when I change params in gulpfile.js to open website in Chrome - I have this information: [Browsersync] Couldn't open browser (if you are using BrowserSync in a headless environment, you might want to set the open option to false) My config in gulpfile.js: // browser-sync options // see: https://www.browsersync.io/docs/options/ var

Browser not launching with BrowserSync or live-server

☆樱花仙子☆ 提交于 2019-12-12 07:16:58
问题 I've been using live-server with VS Code to debug some web pages. Everything was fine, I ran live-server from my command line in the page directory and Chrome opened a new tab with the page. Then suddenly it stopped working! I though it was a bit weird so I installed Nodejs again and an issue appeared afterwards. The server is working but it isn't able to open Chrome (nor any other Browser) I tried using BrowserSync instead of live-server and again, the server works but it isn't able to

Gulp-Connect-Php + browserSync + Gulp-Connect address in use issue

醉酒当歌 提交于 2019-12-12 04:35:17
问题 I need an ability to use browserSync with php support and some specific url rewrites. I came up with browserSync with Gulp-Connect-Php packages plus Gulp-Connect + modrewrite. Here is my config: var browserSync = require('browser-sync'), phpconnect = require('gulp-connect-php'), connect = require('gulp-connect'), modrewrite = require('connect-modrewrite'), phpconnect.server({base:'dist/',port: 8010}, function (){ connect.server({ port: 8001, middleware: function() { return [ modrewrite([ '^

Browser sync not working with gulp when SASS updated

会有一股神秘感。 提交于 2019-12-12 04:11:06
问题 I have a gulpfile with browser sync running and js/sass compiling. It serves my Angular SPA. It looks like this: gulp.task('default', function(){ return runSequence(['build-css', 'build-js'], 'serve-dev'); }); gulp.task('serve-dev', function() { browserSync.init(null, { server: { baseDir: './', middleware: [ modRewrite([ '!\\.\\w+$ /index.html [L]' ]) ] } }); gulp.watch(paths.js.dir + '/**/*.js', ['watch-js']); gulp.watch(paths.css.dir + '/**/*.scss', ['watch-css']); gulp.watch(paths.html.dir