UNPKG

webpack-bundle-analyzer

Version:

Webpack plugin and CLI utility that represents bundle content as convenient interactive zoomable treemap

44 lines (43 loc) 1.14 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = void 0; var _BaseFolder = _interopRequireDefault(require("./BaseFolder")); function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } class ContentFolder extends _BaseFolder.default { constructor(name, ownerModule, parent) { super(name, parent); this.ownerModule = ownerModule; } get parsedSize() { return this.getSize('parsedSize'); } get gzipSize() { return this.getSize('gzipSize'); } get brotliSize() { return this.getSize('brotliSize'); } get zstdSize() { return this.getSize('zstdSize'); } getSize(sizeType) { const ownerModuleSize = this.ownerModule[sizeType]; if (ownerModuleSize !== undefined) { return Math.floor(this.size / this.ownerModule.size * ownerModuleSize); } } toChartData() { return { ...super.toChartData(), parsedSize: this.parsedSize, gzipSize: this.gzipSize, brotliSize: this.brotliSize, zstdSize: this.zstdSize, inaccurateSizes: true }; } } exports.default = ContentFolder; ;