grunt-size-report

Create size report of your project

grunt-size-report

Create size report of your project

This plugin requires Grunt ~0.4.1

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-size-report --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-size-report');

In your project's Gruntfile, add a section named size_report to the data object passed into grunt.initConfig().

grunt.initConfig({
    size_report: {
        your_target: {
            files: {
                list: ['path/to/*.html', 'path/to/images/*.jpg']
            },
        },
    },
})

Generate a size report by adding the compiled project files to the 'list' variable:

grunt.initConfig({
    size_report: {
        files: {
            list: ['path/to/*.html', 'path/to/images/*.jpg']
        },
    },
})

Generate multiple reports by adding different targets to your Grunt config:

grunt.initConfig({
    size_report: {
        images: {
            files: {
                list: ['path/to/images/*.jpg']
            },
        },
        css: {
            files: {
                list: ['path/to/css/*.css']
            },
        },
        fonts: {
            files: {
                list: ['path/to/fonts/*.woff', 'path/to/fonts/*.ttf']
            },
        },
        js: {
            files: {
                list: ['path/to/js/*.js']
            },
        },
    },
})

0.1.0 Initial release