browser-sync

Browsersync within a Docker container

点点圈 提交于 2019-11-28 23:07:03
问题 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:

How to make BrowserSync work with an nginx proxy server?

此生再无相见时 提交于 2019-11-28 18:55:24
(If needed, please see my last question for some more background info.) I'm developing an app that uses a decoupled front- and backend: The backend is a Rails app (served on localhost:3000 ) that primarily provides a REST API. The frontend is an AngularJS app, which I'm building with Gulp and serving locally (using BrowserSync ) on localhost:3001 . To get the two ends to talk to each other, while honoring the same-origin policy , I configured nginx to act as a proxy between the two, available on localhost:3002 . Here's my nginx.conf: worker_processes 1; events { worker_connections 1024; } http

BrowserSync extremely slow

佐手、 提交于 2019-11-28 18:14:48
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/bufferutil.o SOLINK_MODULE(target) Release/bufferutil.node SOLINK_MODULE(target) Release/bufferutil.node

Gulp browser-sync - redirect API request via proxy

一曲冷凌霜 提交于 2019-11-28 17:28:59
问题 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

Node update a specific package

此生再无相见时 提交于 2019-11-28 15:50:30
I want to update my Browser-sync without updating all my node packages . How can I achieve this? My current version of Browser-sync does not have the Browser-sync GUI :( ├─┬ browser-sync@1.9.2 │ ├── browser-sync-client@1.0.2 Most of the time you can just npm update (or yarn upgrade ) a module to get the latest non breaking changes (respecting the semver specified in your package.json) (<-- read that last part again). npm update browser-sync ------- yarn upgrade browser-sync Use npm outdated to see which modules have newer versions Use npm update (without a package name) to update all modules

Can't change the base folder for lite-server in Angular 2 application

拟墨画扇 提交于 2019-11-28 12:09:44
I am going through the 5 minute quickstart of Angular 2 . However, my application resides in src/ folder instead of at the root of my repository, and when I run npm start the application is trying to find an index.html file at the root. I read up on lite-server and documentation shows that it uses BrowserSync and I can reconfigure BrowserSync with a bs-config.json in my repository. I did that and this is what my config looks like: { "port": 8123, "server": { "baseDir": "./src" } } According to the log it's using the specified config: [1] > todo-app-angular2@1.0.0 lite E:\GitHub\todo-app

BrowserSync : Command not found after installing browser-sync

天大地大妈咪最大 提交于 2019-11-28 00:44:23
问题 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 回答1: Check where npm installs it's binaries by running npm bin -g , and

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

為{幸葍}努か 提交于 2019-11-27 23:56:06
问题 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

npm install multiple package names

谁说我不能喝 提交于 2019-11-27 17:23:13
问题 What does it do when I run this command: npm install --save-dev package1 package2 It is definitely not installing multiple packages, but it looks to be essential. (For example https://www.browsersync.io/docs/gulp) For me it throws following ERRs: C:\1HLAVNI\Lukas\Webdesign\lukasradek>npm install --save-dev gulp-babel gulp-add-src > bufferutil@1.1.0 install C:\1HLAVNI\Lukas\Webdesign\lukasradek\node_modules\bufferutil > node-gyp rebuild C:\1HLAVNI\Lukas\Webdesign\lukasradek\node_modules

Gulp-webapp running BrowserSync and PHP

被刻印的时光 ゝ 提交于 2019-11-27 13:21:53
My main goal here is to adapt Yeoman's gulp-webapp development workflow to run PHP. Specifically, I want to be able to use gulp-php-connect with multiple base directories (for the compiled CSS from Sass) and routes (for Bower dependencies), if that's even possible. I'm able to run PHP with Gulp using the gulp-connect-php plugin, like this: gulp.task('connect-php', function() { connectPHP.server({ hostname: '0.0.0.0', bin: '/Applications/MAMP/bin/php/php5.5.3/bin/php', ini: '/Applications/MAMP/bin/php/php5.5.3/conf/php.ini', port: 8000, base: 'dev' }); }); However, I'd like to take advantage of