gulp-watch

Gulp.js stops compiling LESS when watched after there has been an error in the LESS files

半腔热情 提交于 2019-12-04 10:44:39
问题 I'm having a problem with gulp . I run gulp-watch along with gulp-less and gulp-clean . Everything is running perfectly. When I edit somefile.less and I save it with a semi-colon missing or maybe I accidentally leave a trailing ;s , just have errors in my code when saving, gulp-less logs an error in the console. After I fix it gulp-watch continues watching the files, but gulp-less doesn't fire and it doesn't compile. When I stop gulp and run it again in the terminal everything goes back to

Gulp Watch only run once

落花浮王杯 提交于 2019-12-04 09:57:33
问题 I'm using this Gulp Watch sample: https://github.com/floatdrop/gulp-watch/blob/master/docs/readme.md#starting-tasks-on-events. var gulp = require('gulp'); var watch = require('gulp-watch'); var batch = require('gulp-batch'); gulp.task('build', function () { console.log('Working!'); }); gulp.task('watch', function () { watch('**/*.js', batch(function () { gulp.start('build'); })); }); When I run it on my Windows 8 machine, it only runs the first time I change a file: C:\test>gulp watch [08:40

Aurelia CLI app-bundle automatic update gets slow

折月煮酒 提交于 2019-12-04 07:03:47
Hi I have a web application runnig on the Aurelia CLI. From what I’ve read in the documentation , the Aurelia CLI runs always “bundled” and never targeting directly source files. By running the “au run –watch” command, Aurelia “listens” to file changes and recreates the app-bundle.js automatically. Sample output from console: Starting 'readProjectConfiguration'... Finished 'readProjectConfiguration' Starting 'processMarkup'... Starting 'processCSS'... Starting 'configureEnvironment'... Finished 'configureEnvironment' Starting 'buildJavaScript'... Finished 'processCSS' Finished 'processMarkup'

Gulp-watch is not picking up new files

狂风中的少年 提交于 2019-12-03 12:39:33
I'm trying to run a task whenever a file get's changed, delete or a new file is added. The first two work, however: when a new file is added it's not being picked up. I installed the package gulp-watch and I have this task: var gulp = require('gulp'), watch = require('gulp-watch'); gulp.task('watch', function() { watch( ['./src/Scripts/**/*.js'], function(ev, cb) { console.log('test'); cb(); }); }); That was a weird problem. Removing ./ from glob fixes it. var gulp = require('gulp'); var watch = require('gulp-watch'); gulp.task('watch', function() { watch(['src/Scripts/**/*.js'], function

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.

Live reload for electron application

痞子三分冷 提交于 2019-12-03 07:26:17
问题 I want to use a combination of VScode + Gulp + Electron to build an application. A nice feature of the development workflow would be to add an live reload task to my Gulp watch task, to reload the Electron application on every change. Any Idea how to achieve this? Your help is highly appreciated. 回答1: I was able to achieve this with the gulp-livereload plugin. Here is the code to livereload CSS ONLY. It's the same for everything else though. var gulp = require ('gulp'), run = require('gulp

CSS minify and rename with gulp

老子叫甜甜 提交于 2019-12-03 05:36:40
问题 I've a variable like var files = { 'foo.css': 'foo.min.css', 'bar.css': 'bar.min.css', }; What I want the gulp to do for me is to minify the files and then rename for me. But the tasks is currently written as (for one file) gulp.task('minify', function () { gulp.src('foo.css') .pipe(minify({keepBreaks: true})) .pipe(concat('foo.min.css')) .pipe(gulp.dest('./')) }); How to rewrite so it work with my variable files defined above? 回答1: You should be able to select any files you need for your src

Gulp Watch only run once

假装没事ソ 提交于 2019-12-03 04:31:47
I'm using this Gulp Watch sample: https://github.com/floatdrop/gulp-watch/blob/master/docs/readme.md#starting-tasks-on-events . var gulp = require('gulp'); var watch = require('gulp-watch'); var batch = require('gulp-batch'); gulp.task('build', function () { console.log('Working!'); }); gulp.task('watch', function () { watch('**/*.js', batch(function () { gulp.start('build'); })); }); When I run it on my Windows 8 machine, it only runs the first time I change a file: C:\test>gulp watch [08:40:21] Using gulpfile C:\test\gulpfile.js [08:40:21] Starting 'watch'... [08:40:21] Finished 'watch'

Gulp css styles are not updated

做~自己de王妃 提交于 2019-12-02 17:54:22
问题 I have problem. Yestrday I had to update the Node.js kernel and now that I change something in the LESS file, there will be no css update. Gulpfile is the same as before the update. Could someone advise me what's wrong with my gulpfile script? The HTML file update is OK. //*********** IMPORTS ***************** var gulp = require('gulp'), browserSync = require('browser-sync'); var postcss = require('gulp-postcss'); var less = require('gulp-less'); var watch = require('gulp-watch'); var

Gulp wouldn't watch any changes

自古美人都是妖i 提交于 2019-12-02 14:29:35
问题 I am scratching my head around but can't seem to figure out whats wrong with the following gulpfile which simply watch and compile less file. This simply won't watch less changes, I have tried all gulp , gulp watch . I have to manually run gulp after each change to compile them. Is there something wrong that causing watch to not work as expected? Gulp Version CLI version 1.4.0 Local version 3.9.1 NPM 4.1.2 Node v7.7.2 var gulp = require('gulp'); var less = require('gulp-less'); // gulp