O'Reilly logo

Continuous Integration, Delivery, and Deployment by Sander Rossel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Checking file sizes

As you are deleting and minifying files, you may be interested in seeing exactly how many bytes you are saving. There is a plugin for that, called gulp-size:

npm install gulp-size --save-dev

Usage is simple:

var gulp = require('gulp');var minify = require('gulp-minify');var size = require('gulp-size');gulp.task('minify', ['clean'], function () {   gulp.src('scripts/*.js')      .pipe(size())      .pipe(minify(require('./minify.conf.js')))      .pipe(size())      .pipe(gulp.dest('prod'));});

This outputs the size of all the files before and after minification to the command window. You can also pass in some additional options to size:

.pipe(size({   title: 'Before minification',   showFiles: true,   showTotal: true,   pretty: false}))

The title can be ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required