grunt-filesize-report
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "grunt-filesize-report", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "(Very) simple filesize reporter for grunt. Primary use was to generate a very simple xml format for use by Jenkins plot plugin.", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -27,5 +27,5 @@ var fs = require('fs'); | ||
var options = this.options(); | ||
options.output = options.output || {}; | ||
console.log(options) | ||
if (options.output.console !== false) { | ||
if (options.console !== false) { | ||
var widths = [75,10,10,10]; | ||
@@ -44,3 +44,3 @@ var sep = ' '; | ||
if(!options.output.short) { | ||
if(!options.short) { | ||
files.forEach(function (file) { | ||
@@ -55,9 +55,9 @@ grunt.log.writeln(grunt.log.table(widths, [file.filename, sep + file.size.toString(), sep + formatSize(file.kb), sep + formatSize(file.mb)])); | ||
options.output.filename = options.output.folder + '/' + (options.output.filename || 'filesize-' + this.target); | ||
options.filename = options.folder + '/' + (options.filename || 'filesize-' + this.target); | ||
if(options.output.folder) { | ||
grunt.file.mkdir(options.output.folder); | ||
if(options.folder) { | ||
grunt.file.mkdir(options.folder); | ||
} | ||
if (options.output.xml) { | ||
if (options.xml) { | ||
var str = '<filesizes type="'+this.target+'">'; | ||
@@ -70,7 +70,7 @@ | ||
str += '</filesizes>'; | ||
fs.writeFileSync(options.output.filename + '.xml', str); | ||
fs.writeFileSync(options.filename + '.xml', str); | ||
} | ||
if (options.output.json) { | ||
fs.writeFileSync(options.output.filename + '.json',JSON.stringify(files)); | ||
if (options.json) { | ||
fs.writeFileSync(options.filename + '.json',JSON.stringify(files)); | ||
} | ||
@@ -77,0 +77,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32137