gulp-watch

How can Gulp be restarted upon each Gulpfile change?

南楼画角 提交于 2019-12-02 14:04:08
I am developing a Gulpfile . Can it be made to restart as soon as it changes? I am developing it in CoffeeScript. Can Gulp watch Gulpfile.coffee in order to restart when changes are saved? You can create a task that will gulp.watch for gulpfile.js and simply spawn another gulp child_process . var gulp = require('gulp'), argv = require('yargs').argv, // for args parsing spawn = require('child_process').spawn; gulp.task('log', function() { console.log('CSSs has been changed'); }); gulp.task('watching-task', function() { gulp.watch('*.css', ['log']); }); gulp.task('auto-reload', function() { var

Gulp wouldn't watch any changes

冷暖自知 提交于 2019-12-02 12:36:59
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 compile paths var paths = { dist: 'assets/dist' }; gulp.task('css', function() { return gulp.src('assets/less

Gulp css styles are not updated

女生的网名这么多〃 提交于 2019-12-02 07:44:53
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 livereload = require('gulp-livereload'); var autoprefixer = require('gulp-autoprefixer'); var concat = require

Gulp watch not watching file changes

北战南征 提交于 2019-12-02 02:25:36
问题 My gulp-watch task has been started normally, and the gulp command didn't exit too, every seems good. However, when I make changes to my files, I can't see the changes in my output files, and there was nothing logged in the command line. It seems like gulp can't detect that my files was changed. But running the watched tasks alone will work. It is strange. My watch task was working perfectly before. But I can't remember what did I do after the last right run. Here is my directory structure

Gulp watch not watching file changes

☆樱花仙子☆ 提交于 2019-12-02 01:23:57
My gulp-watch task has been started normally, and the gulp command didn't exit too, every seems good. However, when I make changes to my files, I can't see the changes in my output files, and there was nothing logged in the command line. It seems like gulp can't detect that my files was changed. But running the watched tasks alone will work. It is strange. My watch task was working perfectly before. But I can't remember what did I do after the last right run. Here is my directory structure (part of it): ├── README.md ├── bower.json ├── config.xml ├── gulpfile.js ├── ionic.project ├── src │ ├──

Gulp watch all files but render only one (sass)

最后都变了- 提交于 2019-12-01 17:31:07
问题 I want to make gulp watch for all changes on my work folders but to generate only one file. Because I use scss which imports all required files, there is no need to compile all .css files, only main one. Now, my gulpfile.js contains: var gulp = require('gulp'); var util = require('gulp-util'); var sass = require('gulp-sass'); gulp.task('sass', function () { return gulp.src('./sass/style.scss') .pipe(sass().on('error', sass.logError)) .pipe(gulp.dest('./dist/css')); }); gulp.task('watch',

Gulp run alternative

。_饼干妹妹 提交于 2019-12-01 06:31:24
Everytime I run gulp, I see this message gulp.run() has been deprecated. Use task dependencies or gulp.watch task triggering instead. Example code: var watch = require('gulp-watch'); watch(['public/**/*.js','!public/**/*.min.js'],function(){ gulp.run('compressjs'); gulp.run('bs-reload'); }); How can I avoid using gulp.run() with gulp-watch? You shouldn't use run . Here is an alternative (to address that part of your answer), but not what you need to do: gulp .start('default') .once('task_stop', function(){ //do other stuff. }); If you really must fire an ad hoc task, but can literally use run.

Gulp run alternative

巧了我就是萌 提交于 2019-12-01 05:18:17
问题 Everytime I run gulp, I see this message gulp.run() has been deprecated. Use task dependencies or gulp.watch task triggering instead. Example code: var watch = require('gulp-watch'); watch(['public/**/*.js','!public/**/*.min.js'],function(){ gulp.run('compressjs'); gulp.run('bs-reload'); }); How can I avoid using gulp.run() with gulp-watch? 回答1: You shouldn't use run . Here is an alternative (to address that part of your answer), but not what you need to do: gulp .start('default') .once('task

Gulp Error: watch ENOSPC

浪尽此生 提交于 2019-12-01 04:00:14
Hi i'm getting this error while running gulp watch. im using vueify in laravel project. why is this happening. it was working fine all these days and this came in today. $ gulp watch [12:56:01] Using gulpfile ~/Documents/web_projects/next-home/gulpfile.js [12:56:01] Starting 'watch'... [12:56:01] Starting 'browserify'... Fetching Browserify Source Files... - resources/assets/js/app.js Saving To... - public/js/app.js [12:56:02] Finished 'browserify' after 707 ms [12:56:02] 'watch' errored after 722 ms [12:56:02] Error: watch /home/bazi/Documents/web_projects/next-home/resources/assets/less/

Why don't newly added files trigger my gulp-watch task?

霸气de小男生 提交于 2019-11-30 19:08:54
I have a gulp task which uses gulp-imagemin to compress images. When I add new files to this directory I'd like for this task to compress them as well. I read that gulp.watch doesn't trigger on new files and that I should try gulp-watch so I used it like so; gulp.task('images', function() { watch({glob: './source/images/*'}, function (files) { return files .pipe(plumber()) .pipe(imagemin({ progressive: true, interlaced: true })) .pipe(gulp.dest('./www')); }); }); This works the same as gulp.watch on the first run, but when I add a new image to the directory nothing happens. If I overwrite an