Giter Site home page Giter Site logo

Comments (6)

floatdrop avatar floatdrop commented on July 17, 2024

As far I can understand, you are looking for passThrough option:

// ...
.pipe(watch({
      name: "Coffee",
      passThrough: false
    }))
// ...

from gulp-watch.

lmartins avatar lmartins commented on July 17, 2024

I believe that's still not it, I mean i've tried it and it still only outputs [gulp] Coffee saw main.coffee was changed the first time I change the file. Every subsequent change doesn't show anything in terminal, although the file is compiled as expected.

from gulp-watch.

VasilioRuzanni avatar VasilioRuzanni commented on July 17, 2024

@floatdrop There is indeed such a behavior (highly undesired). The desired behavior is like here at the image on gulp-watch page but what being output to the console is just first time some watcher "saw somefile changed".

There is also no string like "Sass is watching 3 files", verbose: true doesn't help either.

P.S. Watching behavior itself is correct though, so it's a matter of correct terminal output.

from gulp-watch.

floatdrop avatar floatdrop commented on July 17, 2024

@lmartins @VasilioRuzanni yeah, this is not what expected to be. I'm not quite sure about cause of this behavior, because logging code is really simple and should work - https://github.com/floatdrop/gulp-watch/blob/master/index.js#L63-L64

from gulp-watch.

lmartins avatar lmartins commented on July 17, 2024

Im closing as im not sure if what I was trying to achieve is expected behaviour.

But just to be clearer, my default approach is to have a task for compilation and another for watching, like this:

gulp.task('coffee', function () {
  gulp.src( options.COFFEE.src )
    .pipe(changed( options.COFFEE.build , { extension: '.js' }))
    .pipe(coffeelint())
    .pipe(coffeelint.reporter())
    .pipe(coffee({
      bare: true,
      sourceMap: true
      })
    .on('error', gutil.log))
    .pipe(gulp.dest( options.COFFEE.build ))
    .pipe(connect.reload());
});

gulp.task('watch', function () {
  gulp.watch( options.COFFEE.src , ['coffee']);
});

This does output information every time I change and save a file:

[gulp] Starting 'coffee'...
[gulp] Finished 'coffee' after 15 ms

I thought that by adding the pipe watch in the coffee task itself would achieve the same result but that doesn't seem to be the case, again, this was just my assumption.

gulp.task('coffee', function () {
  gulp.src( options.COFFEE.src )
    .pipe(watch({
       name: "Coffee"
    }))
    .pipe(changed( options.COFFEE.build , { extension: '.js' }))
    .pipe(coffeelint())
    .pipe(coffeelint.reporter())
    .pipe(coffee({
      bare: true,
      sourceMap: true
      })
    .on('error', gutil.log))
    .pipe(gulp.dest( options.COFFEE.build ))
    .pipe(connect.reload());
});

from gulp-watch.

floatdrop avatar floatdrop commented on July 17, 2024

This issue is continued in #40

from gulp-watch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.