browser-sync

Why does Gulp fail to automatically re-process my JS upon changes?

a 夏天 提交于 2019-12-05 05:22:31
In my gulpfile.js , JS changes automatically trigger both BrowserSync reload and my JS processing task. But for some reason, although the reload does work, my JS task fails to correctly process JS changes and create new JS file in dist/ folder. I have to restart Gulp for that. Why? Gulpfile.js: var gulp = require('gulp'); var sass = require('gulp-sass'); var browserSync = require('browser-sync').create(); var concat = require('gulp-concat'); var jshint = require('gulp-jshint'); var uglify = require('gulp-uglify'); gulp.task('sass', function() { return gulp.src('../assets/styles/**/*.scss')

Express and BrowserSync without gulp?

て烟熏妆下的殇ゞ 提交于 2019-12-04 23:53:11
问题 I'm working on an express app. I used browserSync only to watch static files but now, I want to do the same with an express app. I saw a lot of examples using Gulp. But i wonder if there is any solution to manage only with npm scripts? (and nodemon?) My current scripts: "scripts": { "start": "npm run start-server & npm run watch-js", "build-js": "browserify -t babelify -t aliasify -t partialify src/ | uglifyjs > public/app.js", "start-server": "browser-sync start --server 'public/' --files

Browser refresh after breakpoint

杀马特。学长 韩版系。学妹 提交于 2019-12-04 23:35:29
问题 Something that drives me crazy, it started suddenly to all my team members. If you pause at a breakpoint for more than a couple of seconds and then continue (F8) the browser refreshes the page. it happens on our mac and windows machines. We are running an AngularJS project with gulp and browser-sync. Even if i turn of all the watchers it still happens. What can i do?? 回答1: browserSync.init({ files: ['./**/*'], startPath: '/src', server: '', watchOptions: { ignored: 'node_modules/*',

browser-sync is blocked by chrome csp

守給你的承諾、 提交于 2019-12-04 13:55:27
I have a gulp task that runs browsersync. var options = { proxy : 'localhost:9000/html' , port : 3000 , files : [ config.root + config.srcPaths.htmlBundle , config.htmlRoot + 'main.css' , '!' + config.htmlRoot + '**/*.scss' ] , injectChanges : false , logFileChanges : true , logPrefix : 'broserSync ->' , notify : true , reloadDelay : 1000 }; browserSync( options ); browsersync detects changes and tries to inject them but chrome blocks it with this error: Refused to connect to 'ws://localhost:3000/browser-sync/socket.io/?EIO=3&transport=websocket&sid=gOQQPSAc3RBJD2onAAAA' because it violates

How do I get gulp + browsersync to work an apache vhost?

南笙酒味 提交于 2019-12-04 05:39:05
I'd like to add gulp, sass and browsersync to my toolkit. I'm now running gulp with a sass and browsersync task configured. I'm skinning a php app running from a vhost on my local apache server. I'm attempting to run browsersync from a watch task, using the browsersync's proxy option to use my vhost. Currently, when I run the watch no server can be found on port 3000. If I navigate to 'localhost:3000' I get chromes 'no web page found' message. If I navigate to port 3001 I can access browsersync's admin UI. So I know that browsersync is running. My gulp conf is as follows /* load plugins */ var

Browser-sync TypeError args.cb is not a function

你说的曾经没有我的故事 提交于 2019-12-03 12:17:32
I'm using browser-sync in gulp task for example : gulp.task('gulp-task',function(){ browserSync.init({ server:{ baseDir: 'app' } }) //rest of task }); I use this gulp task in gulp watch for( for example ) app/**/*.html like : gulp.task('watch',function(){ gulp.watch('app/**/*.html', ['gulp-task']); }); for first time change in html files everything is ok but for next changes i get error: TypeError: args.cbn is not a function ... guys said to install latest version for browser-sync with command below : npm install browser-sync@latest --save-dev and it doesn't helped. I'm getting the same error.

Browser-sync in mobile while local development

五迷三道 提交于 2019-12-03 08:34:32
How can I view my local dev website in my phone using gulp Browser-sync? I type localhost:3000 in my phones browser but it won't load When you run gulp in your terminal you should see : [BS] Access URLs: -------------------------------------- Local: http://localhost:3000 External: http://192.168.10.81:3000 -------------------------------------- UI: http://localhost:3001 UI External: http://192.168.10.81:3001 What it means is that your local URL is localhost at port 3000. For external users it will be the external IP [ not the UI one ]. To access from your phone you need to enter the External

How to configure port in browser-sync

99封情书 提交于 2019-12-03 05:57:07
I have a gulp task running with browser-sync ,by default its running on port 3000 of node.js server.I want to change the default port to any other port like 3010. var gulp = require('gulp'), connect = require('gulp-connect'), browserSync = require('browser-sync'); gulp.task('serve', [], function() { browserSync( { server: "../ProviderPortal" }); }); /*** 8. GULP TASKS **********/ gulp.task('default', ['serve']); I am using: browser-sync version-2.6.1 I tried configuring the gulp task like: gulp.task('serve', [], function() { browserSync( { ui: { port: 8080 }, server: "../ProviderPortal" }); })

browser-sync does not refresh page after changes with Gulp

大憨熊 提交于 2019-12-03 05:46:17
问题 I'm new to Gulp and I wanted to make use of its automatic scss compiling and browser sync. But I can't get it to work. I stripped everything down to leave only the contents of the example on the Browsersync website: http://www.browsersync.io/docs/gulp/#gulp-sass-css var gulp = require('gulp'); var browserSync = require('browser-sync').create(); var sass = require('gulp-sass'); // Static Server + watching scss/html files gulp.task('serve', ['sass'], function() { browserSync.init({ server: ".