import Bundle from "./bundle"; import { BaseSize } from "./types"; /** * Size information pertaining to a module * * @beta */ export interface ModuleSizes extends BaseSize { /** * The portion of this module's bundle's size that this module is responsible for */ minifiedBundlePortion: number; /** * The gzipped size of this module _when compressed individually_ */ individualGzSize: number; /** * The brotli'd size of this module _when compressed individually_ */ individualBrSize: number; } /** * File within a bundle, within a project * * @beta */ export default class Module { /** * The bundle that this module belongs to */ readonly bundle: Bundle; /** * This module's name */ readonly name: string; private reportedSize; private _realpath; /** * The contents of this module */ contents: string; /** * The folder in which "specimens" (minified and compressed variants of the file) will be written */ private fileSamplesDir; private _sizes?; /** * Size information pertaining to this module */ get sizes(): ModuleSizes; /** * The percentage of size that this module contributes to its minified bundle */ get minifiedBundlePortion(): number; /** * @param bundle - bundle that this file belongs to * @param name - name of this file * @param reportedSize - size reported by broccoli-concat-stats */ constructor( /** * The bundle that this module belongs to */ bundle: Bundle, /** * This module's name */ name: string, reportedSize: number); }