Diff file sizes between current git branch and a branch/commit.
Helps you keep an eye on your project size changes.
$ npm install --save-dev grunt-sizediff
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.
sizediff: {
dist: {
options: {
target: 'future' // branch
},
src: [
'file.js',
'file.min.js'
]
}
}
sizediff: {
dist: {
options: {
target: 'fd9b092' // commit
},
src: [
'file.js',
'file.min.js'
]
}
}
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.
MIT © Sindre Sorhus