Diff file sizes between current git branch and a branch/commit
JavaScript
Latest commit bb4c88d May 25, 2016 @sindresorhus 1.2.0
Failed to load latest commit information.
tasks Include percentage difference (#4) May 25, 2016
test/fixtures Add tests May 9, 2012
.editorconfig minor tweaks Apr 8, 2016
.gitattributes tweaks Aug 29, 2014
.gitignore Update and add dotfiles Aug 25, 2012
gruntfile.js meta tweaks Apr 8, 2016
license tweaks Aug 29, 2014
package.json 1.2.0 May 25, 2016
readme.md minor tweaks Apr 8, 2016
screenshot.png grunt 0.4 compatibility Feb 2, 2013

readme.md

grunt-sizediff

Diff file sizes between current git branch and a branch/commit.
Helps you keep an eye on your project size changes.

Install

$ npm install --save-dev grunt-sizediff

Usage

require('load-grunt-tasks')(grunt); // npm install --save-dev load-grunt-tasks

grunt.initConfig({
    sizediff: {
        dist: {
            src: [
                'file.js',
                'file.min.js' // optional
            ]
        }
    }
});

grunt.registerTask('default', ['sizediff']);

You can specify two files to diff and an optional target. It falls back to master if target is not specified.

Diff against a branch

sizediff: {
    dist: {
        options: {
            target: 'future' // branch
        },
        src: [
            'file.js',
            'file.min.js'
        ]
    }
}

Diff against a commit

sizediff: {
    dist: {
        options: {
            target: 'fd9b092' // commit
        },
        src: [
            'file.js',
            'file.min.js'
        ]
    }
}

Override target

You can temporarily override the diff target of a task by running grunt sizediff:dist:target, where dist is the task target you want to override and target is the branch or commit.

License

MIT © Sindre Sorhus