browser-sync

Gulp browser-sync - redirect API request via proxy

匿名 (未验证) 提交于 2019-12-03 02:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to redirect my API requests like this with gulp and browser-sync: gulp.task('browser-sync', function () { var files = [ '../index.html', '../views/**/*.html', '../assets/css/**/*.css', '../assets/js/**/*.js' ]; var url = require('url'), proxy = require('proxy-middleware'); var proxyOptions = url.parse('http://localhost:8000/api'); proxyOptions.route = '/api'; browserSync.init(files, { server: { baseDir: '..', middleware: [proxy(proxyOptions)] } }); }); But I get this response when a call is sent to the API: Error: connect

Chrome can't open localhost:3000 with Gulp / BrowserSync

╄→гoц情女王★ 提交于 2019-12-01 06:51:00
For some reason, no matter what I try, Google Chrome never seems to be able to display http://localhost:3000 (or any other specified port number for that matter) when starting up a server with BrowserSync through Gulp. Navigating to the same URI in Firefox, shows that it works and that BrowserSync is connected . gulp.task('browser-sync', function() { browserSync.init({ server: { baseDir: './' }, port: 8080 }); }); I'm specifying port 8080 above as an alternative , but even using the default 3000 does not work in Chrome. Firefox seems to be able to work with either. I've been to: chrome://net

npm WARN optional dep failed, continuing fsevents@0.3.6

不羁岁月 提交于 2019-11-30 13:47:22
问题 I am install browserSync npm install browser-sync but have a problem npm WARN optional dep failed, continuing fsevents@0.3.6 What is this error and how it can be solved ? gulp does not start P.S: It worked before . Already 2 project so created. clear cache - not help 回答1: Hi fsevents is an API available only on OSX. So if you're using another OS like Windows as do I. Normally software that wants to use fsevents will provide an alternative or make it optional as your message reads. To my

npm WARN optional dep failed, continuing fsevents@0.3.6

穿精又带淫゛_ 提交于 2019-11-30 08:24:58
I am install browserSync npm install browser-sync but have a problem npm WARN optional dep failed, continuing fsevents@0.3.6 What is this error and how it can be solved ? gulp does not start P.S: It worked before . Already 2 project so created. clear cache - not help Hi fsevents is an API available only on OSX. So if you're using another OS like Windows as do I. Normally software that wants to use fsevents will provide an alternative or make it optional as your message reads. To my knowledge it will not stop gulp from running. I hope this can at least solve your problem or help you towards a

How to disable cross-device action mirroring functionality of BrowserSync? (GhostMode)

让人想犯罪 __ 提交于 2019-11-30 05:50:53
Our team used the gulp-angular generator with yeoman to scaffold out our web app. It uses browsersync to handle live reloads, which we want. However, we just deployed to our development server, and now when two developers are using the gulp serve command at the same time, they both are shown the same window (i.e. one developer types on one window, it shows up in the other developer's window as well). I believe this is due to BrowserSync's cross-device testing capabilities, however I am at a loss for how to disable this feature. If anyone knows how to do this (preferably without disabling our

Browsersync within a Docker container

落花浮王杯 提交于 2019-11-30 02:10:40
I've got a Wordpress/MySQL docker container, which I use for developing themes & plugins. I access this on localhost:8000. It uses a Gulp build process & I am trying to add browsersync to the mix. I'm having a hard time getting the browsersync to actually proxy out of the container. From the Gulp output I can see that its generating the changes, just not actually making any changes in the browser. Heres my docker-compose.yml, gulpfile, dockerfile & shell script. version: '2' services: wordpress_db: image: mariadb restart: 'always' ports: - 3360:3306 volumes: - ./db_data:/docker-entrypoint

Gulp browser-sync - redirect API request via proxy

 ̄綄美尐妖づ 提交于 2019-11-29 21:25:44
I'm trying to redirect my API requests like this with gulp and browser-sync: gulp.task('browser-sync', function () { var files = [ '../index.html', '../views/**/*.html', '../assets/css/**/*.css', '../assets/js/**/*.js' ]; var url = require('url'), proxy = require('proxy-middleware'); var proxyOptions = url.parse('http://localhost:8000/api'); proxyOptions.route = '/api'; browserSync.init(files, { server: { baseDir: '..', middleware: [proxy(proxyOptions)] } }); }); But I get this response when a call is sent to the API: Error: connect ECONNREFUSED at errnoException (net.js:904:11) at Object

BrowserSync : Command not found after installing browser-sync

老子叫甜甜 提交于 2019-11-29 07:14:14
There was another issue open with the same title which has been closed but my error could not be resolved using the solutions given in that issue. Mac OSX El Capitan Node [v5.6.0] Npm [v3.6.0] I installed Browser-Sync successfully using : bash $ sudo npm install -g browser-sync but when I check the browser-sync version by typing : bash $ browser-sync --version I get this error : bash -bash: browser-sync: command not found Check where npm installs it's binaries by running npm bin -g , and then add that to your PATH . export PATH=$PATH:/usr/local/bin 来源: https://stackoverflow.com/questions

For Angular2, why do two pages (two tabs) having the same component affect each other?

强颜欢笑 提交于 2019-11-29 06:26:43
This is an Angular2 app, and the component is simplified here as: @Component({ selector: 'courses', template: ` <input [(ngModel)]="wahla"> <input [(ngModel)]="wahla"> {{ wahla }} ` }) export class CoursesComponent { wahla = "hmm hmm ha ha"; } I think the app works fine in one page with the two-way binding, but if I open up another tab with http://localhost:3000/ and then paste something or type something in the first page's first input box, then the second tab actually gets updated for its first input box, while the 2nd input box and the static text do not update. For the first tab,

How to disable cross-device action mirroring functionality of BrowserSync? (GhostMode)

非 Y 不嫁゛ 提交于 2019-11-29 05:10:15
问题 Our team used the gulp-angular generator with yeoman to scaffold out our web app. It uses browsersync to handle live reloads, which we want. However, we just deployed to our development server, and now when two developers are using the gulp serve command at the same time, they both are shown the same window (i.e. one developer types on one window, it shows up in the other developer's window as well). I believe this is due to BrowserSync's cross-device testing capabilities, however I am at a