export function logBundle(file, duration, stats){
    let paddedFileName = file;
    while(paddedFileName.length<40){ paddedFileName += ' ';}
    
    let paddedDuration = (Math.round(duration/10)/100).toFixed(2)+"s";
    let durationAnsi = (duration/1000)<10? '[32m' // GREEN is <10sec
        : (duration/1000)<60? "[33m" // YELLOW if >10sec
            : "[31m"; // RED if >60sec
    while(paddedDuration.length<8){ paddedDuration = ' '+paddedDuration;}
    
    let fileSize = stats.size;
    let paddedSize = fileSize/1024;
    let unit = 'kb';
    if(paddedSize>1024){
        paddedSize /= 1024;
        unit = 'mb';
    }
    paddedSize = (Math.round(paddedSize*10)/10).toFixed(1)+unit;
    while(paddedSize.length<8){ paddedSize = ' ' + paddedSize;}
    let sizeAnsi = (fileSize/1024)<50? '[32m' // GREEN is <50kb
        : (fileSize/1024)<500? "[33m" // YELLOW if >50kb
            : "[31m"; // RED if >500kb
    
    console.log([paddedFileName, `${durationAnsi}${paddedDuration}[m`, `${sizeAnsi}${paddedSize}[m`].join('\t'))
}