gulp-watch

Gulp src returns empty file

杀马特。学长 韩版系。学妹 提交于 2019-12-10 12:53:39
问题 I'm trying to create Gulp task for sass/js compilation and I've also included code for live reload. It works fine except that sometimes gulp.src throws empty files into the pipe when I edit them. var gulp = require('gulp'); var sass = require('gulp-sass'), concat = require('gulp-concat'), uglify = require('gulp-uglify'), rename = require('gulp-rename'), clean = require('gulp-clean'), debug = require('gulp-debug'), livereload = require('gulp-livereload'), lr = require('tiny-lr'), server = lr()

Browser-sync TypeError args.cb is not a function

て烟熏妆下的殇ゞ 提交于 2019-12-09 09:18:45
问题 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

gulp-nunjucks-html + gulp-data not compiling on watch

六月ゝ 毕业季﹏ 提交于 2019-12-08 21:03:30
I've written a gulp task to take data from json files and process it as html. When I first run the build this works like a charm, however I've set up a watch task to also do this and although it will rebuild the nunjucks file into html, it seems to ignore the json until the next full build (even though all the watch does is run the same task) here is my task: // Process nunjucks html files (.nunjucks) gulp.task('nunjucks', function() { 'use strict'; return gulp.src('src/html/pages/**/*.nunjucks') .pipe(plumber( { errorHandler: onError } )) .pipe(data(function(file) { return require('./src

Delay in gulp watch

梦想与她 提交于 2019-12-08 12:50:52
问题 Currently I'm working true ftp and running gulp watch on te server, now te problem is that when my gulp watch is detecting changes the file is not ready with uploading, so I need to have a delay in my gulp watch. gulp.task('watch', function() { setTimeout(function() { gulp.watch(config.js.app.pathIn + '/**/*.js', ['js_app']); gulp.watch(config.js.vendor.pathIn + '/**/*.js', ['js_vendor']); gulp.watch(config.scss.pathIn + '/**/*.scss', ['scss']); }, 3000); }); This is not delaying the

Laravel Elixir not watching SASS import files for gulp

六眼飞鱼酱① 提交于 2019-12-08 02:59:57
问题 I have elixir set up to watch changes in .scss files, but changes in _partials.scss are not being watched. elixir(function(mix){ mix.browserSync([ 'resources/assets/bower/bootstrap-sass/assets/**/*' ], { proxy: 'site.app', reloadDelay: 200 }); }); When I edit the bootstrap/_variables.scss, gulp does compile those sass changes. If I exit gulp watch, and gulp watch again, then those changes appear. So I know its compiling correctly, its just somehow not watching those partial files. Any ideas?

Watching files for changes on Vagrant, file modification times not updating

白昼怎懂夜的黑 提交于 2019-12-08 01:10:33
问题 We're trying out Vagrant. We have a web application directory on the host shared with the guest via NFS. While developing the website we quickly started to hit issues. We are running gulp-watch to spot changes to stylesheet and javascript files and run tasks, but changes were not being picked up for up to one minute. Also, Laravel was not noticing that blade templates were being changed, and so was not recompiling them and the old view templates were being shown. I eventually boiled down the

Send arguments to gulp task

大兔子大兔子 提交于 2019-12-06 14:05:30
问题 There are other questions on stackoverflow about this topic, but not the one I was hoping for. Here is a simplified version of my gulpfile.js var gulp = require('gulp'); var sass = require('gulp-sass'); gulp.task('css', function() { gulp.src('site/scss/style.scss') .pipe(sass()) .pipe(gulp.dest('assets/css')) }); gulp.task('watch', function() { gulp.watch('site/scss/**/*.scss', ['css']); }); I can do this successfully: gulp watch Now I want to be able to do something like this in my terminal

Gulp plugin for running a PHP server?

馋奶兔 提交于 2019-12-06 06:38:51
I'm looking to transition over from grunt to gulp. However I'm not finding a way to serve PHP files with livereload support, such as gateway ( https://www.npmjs.org/package/gateway ) using mounts. Are ther any plugins out there for running/server PHP using a gulp task? 来源: https://stackoverflow.com/questions/26226881/gulp-plugin-for-running-a-php-server

Watching files for changes on Vagrant, file modification times not updating

做~自己de王妃 提交于 2019-12-06 05:48:31
We're trying out Vagrant. We have a web application directory on the host shared with the guest via NFS. While developing the website we quickly started to hit issues. We are running gulp-watch to spot changes to stylesheet and javascript files and run tasks, but changes were not being picked up for up to one minute. Also, Laravel was not noticing that blade templates were being changed, and so was not recompiling them and the old view templates were being shown. I eventually boiled down the problem to a very short PHP script to demonstrate the error. <?php header('Content-Type: text/plain');

Starting Node.js server w/ Gulp “connect” breaks on live reload (Angular app w/ html5 mode)

China☆狼群 提交于 2019-12-06 05:15:18
I'm trying to solve a problem that's been bugging me for awhile. The Scenario: The problem is when I use Gulp to start up my local server w/ Live Reload. It starts up my Angular app just fine, but when I make a file change Live Reload (page refreshes) breaks my app and gives me a "CANNOT GET" because my server.js (node server) file has a special way that it redirects the user to my "index.html" file. The reason for this is because I have "HTML5 mode" enabled in the Angular app (for pretty URL's) and I have to specify this in the server.js file for it to properly work. Before I turned "html5 on