function formatBytes maybe retrun bundleSize is kb、mb、gb
but the sizeLimit must be bytes
I think they cannot compare each other because of different unit
function formatBytes(bytes, decimals = 2) {
// ...
return {
bundleSize: parseFloat((bytes / Math.pow(k, i)).toFixed(dm)),
fullSizeInfo: parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i]
}
}
messageLoggin(bundleSize, fullSizeInfo) {
const {
sizeLimit
} = this.pluginOptions
if (bundleSize < sizeLimit) {
info("Safe:Bundle-Size", fullSizeInfo)
this.sizeLimitSafeHandler(bundleSize)
}
// ....
}
function
formatBytesmaybe retrun bundleSize is kb、mb、gbbut the sizeLimit must be bytes
I think they cannot compare each other because of different unit