Code Monkey home page Code Monkey logo

Comments (6)

sindresorhus avatar sindresorhus commented on June 7, 2024

Tests disagrees:

gulp-size/test.js

Lines 121 to 122 in b263236

assert.strictEqual(stream.size, 13);
assert.strictEqual(stream.prettySize, '13 B');

from gulp-size.

dvlden avatar dvlden commented on June 7, 2024

Is there any way that I can track down the issue, because this is what it is shown back to me...
Console Preview

from gulp-size.

edphn avatar edphn commented on June 7, 2024

Same issue here. The problem occurs when I'm trying to display prettySize in gulp-notify. In console everything works fine.

from gulp-size.

vovayatsyuk avatar vovayatsyuk commented on June 7, 2024
  1. Make sure you are using gulp-size and not gulp-filesize package. (It was my mistake)
  2. Make sure that onLast option is set to true.
  3. Make sure you are using a function for message in notify options, and call for s.prettySize inside of it.
  4. Don't forget to call .pipe(s)

Example:

.pipe(s)
.pipe(notify({
    onLast: true,
    message: function () {
        return 'See <%= file.relative %> ' + s.prettySize;
    }
}));

from gulp-size.

edphn avatar edphn commented on June 7, 2024

@vovayatsyuk Thank you. Works like a charm right now.

from gulp-size.

dvlden avatar dvlden commented on June 7, 2024

I have decided yesterday to rewrite my gulp tasks and change structure... I couldn't get notify to work at all, but size did work this time in console output.

So I tried to pipe gulp-size and then gulp-notify and then the gulp.dest and in this order everything works as suppoused.

It did not work before at all, because I had size and notify right after destination.

from gulp-size.

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.