No description, website, or topics provided.
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


A Grunt plugin for logging filesize.


modify your grunt.js file by adding the following line:


Then add some configuration for the plugin like so:

  filesize: {
    base: {
      files: [
        {expand: true, cwd: 'build', src: ['*.css', '*.js']}
      options: {
        ouput: [
            stdout: true
            path: "output/file/{now:MMMDDYYYY}.csv",
            format: {filename},{size:0,0}
            path: "output/file/filename.txt",
            format: "{now:YYYY/MM/DD} {filename} {mb} mb",
            append: true


format(string | function) not required.

Specify the format of the file to be output.

Specify the format in the placeholder if you have set in the String. Possible placeholder is as follows.

placeholder type description
fullpath string full absolute file path
filename string file name
basename string last portion of a path
size number file size (bytes)
kb number file size (kb)
mb number file size (mb)
now date output date

Placeholder I enclosed in curly braces. It is possible to specify the color and format. Color is valid only if the standard output.



Color specification the contents of the colors can be specified. Format specification can be specified only in the date type or numeric type. Date type format use the moment. Number type format use the numeral.

output(array | string) not required.

Output options is specify the output destination and format.

Possible property is as follows.

ploperty type description
stdout bool output to console. If true is specified, the path property is ignored.
path string output file name. You can specify the place holder.
append bool Append the results to output file.
format string,function Same format option

reporting(function) not required.


Setting the 'reporting' option will generate a properties file on the given path for each file measured, you can use those in the Jenkins Plot plugin or other ways.


options: {
  reporting: function (filePath) {
    return 'target/grunt/filesize/' + filePath + '.txt';