• Version 4.4.1
  • Published
  • 13 kB
  • 3 dependencies
  • MIT license


npm i @types/webpack-bundle-analyzer
yarn add @types/webpack-bundle-analyzer
pnpm add @types/webpack-bundle-analyzer


TypeScript definitions for webpack-bundle-analyzer



class BundleAnalyzerPlugin

class BundleAnalyzerPlugin implements WebpackPluginInstance {}


    constructor(options?: BundleAnalyzerPlugin.Options);

      method apply

      apply: (compiler: Compiler) => void;


        namespace BundleAnalyzerPlugin

        namespace BundleAnalyzerPlugin {}

          interface JsonReportItem

          interface JsonReportItem {}

            property concatenated

            concatenated?: boolean | undefined;

              property groups

              groups?: JsonReportItem[] | undefined;

                property gzipSize

                gzipSize: number;
                • in bytes

                property id

                id?: number | null | undefined;

                  property inaccurateSizes

                  inaccurateSizes?: boolean | undefined;

                    property isAsset

                    isAsset?: boolean | undefined;

                      property label

                      label: string;

                        property parsedSize

                        parsedSize: number;
                        • in bytes

                        property path

                        path?: string | undefined;

                          property statSize

                          statSize: number;
                          • in bytes

                          interface Options

                          interface Options {}

                            property analyzerHost

                            analyzerHost?: string | undefined;
                            • Host that will be used in server mode to start HTTP server. ''

                            property analyzerMode

                            analyzerMode?: 'server' | 'static' | 'json' | 'disabled' | undefined;
                            • Can be "server", "static" or "disabled". Defaults to "server". In "server" mode analyzer will start HTTP server to show bundle report. In "static" mode single HTML file with bundle report will be generated. In "json" mode single JSON file with bundle report will be generated In "disabled" mode you can use this plugin to just generate Webpack Stats JSON file by setting "generateStatsFile" to true.

                            property analyzerPort

                            analyzerPort?: number | 'auto' | undefined;
                            • Port that will be used in server mode to start HTTP server. 8888

                            property defaultSizes

                            defaultSizes?: 'parsed' | 'stat' | 'gzip' | undefined;
                            • Module sizes to show in report by default. Should be one of "stat", "parsed" or "gzip". 'parsed'

                            property excludeAssets

                            excludeAssets?: null | ExcludeAssetsPattern | ExcludeAssetsPattern[] | undefined;
                            • Patterns that will be used to match against asset names to exclude them from the report. If pattern is a string it will be converted to RegExp via new RegExp(str). If pattern is a function it should have the following signature (assetName: string) => boolean and should return true to exclude matching asset. If multiple patterns are provided asset should match at least one of them to be excluded. null

                            property generateStatsFile

                            generateStatsFile?: boolean | undefined;
                            • If true, Webpack Stats JSON file will be generated in bundles output directory. false

                            property logLevel

                            logLevel?: 'info' | 'warn' | 'error' | 'silent' | undefined;
                            • Log level. Can be "info", "warn", "error" or "silent". 'info'

                            property openAnalyzer

                            openAnalyzer?: boolean | undefined;
                            • Automatically open report in default browser. true

                            property reportFilename

                            reportFilename?: string | undefined;
                            • Path to bundle report file that will be generated in "static" mode. Relative to bundles output directory. 'report.html'

                            property reportTitle

                            reportTitle?: string | (() => string) | undefined;
                            • Content of the HTML title element; or a function of the form () => string that provides the content. function that returns pretty printed current date and time.

                            property statsFilename

                            statsFilename?: string | undefined;
                            • Name of Webpack Stats JSON file that will be generated if generateStatsFile is true. Relative to bundles output directory. 'stats.json'

                            property statsOptions

                            statsOptions?: null | Stats.ToJsonOptionsObject | undefined;
                            • Options for stats.toJson() method. For example you can exclude sources of your modules from stats file with "source: false" option. null

                            type ExcludeAssetsPattern

                            type ExcludeAssetsPattern = string | RegExp | ExcludeAssetsPatternFn;

                              type ExcludeAssetsPatternFn

                              type ExcludeAssetsPatternFn = (assetName: string) => boolean;

                                type JsonReport

                                type JsonReport = JsonReportItem[];
                                • The json report that will be produced if analyzerMode: 'json'

                                namespace BundleAnalyzerPlugin.Stats

                                namespace BundleAnalyzerPlugin.Stats {}

                                  interface ToJsonOptionsObject

                                  interface ToJsonOptionsObject {}

                                    property all

                                    all?: boolean | undefined;
                                    • fallback value for stats options when an option is not defined (has precedence over local webpack defaults)

                                    property assets

                                    assets?: boolean | undefined;
                                    • Add asset Information

                                    property assetsSort

                                    assetsSort?: string | undefined;
                                    • Sort assets by a field

                                    property builtAt

                                    builtAt?: boolean | undefined;
                                    • Add built at time information

                                    property cached

                                    cached?: boolean | undefined;
                                    • Add information about cached (not built) modules

                                    property cachedAssets

                                    cachedAssets?: boolean | undefined;
                                    • Show cached assets (setting this to false only shows emitted files)

                                    property children

                                    children?: boolean | undefined;
                                    • Add children information

                                    property chunkGroups

                                    chunkGroups?: boolean | undefined;
                                    • Add information about the namedChunkGroups

                                    property chunkModules

                                    chunkModules?: boolean | undefined;
                                    • Add built modules information to chunk information

                                    property chunkOrigins

                                    chunkOrigins?: boolean | undefined;
                                    • Add the origins of chunks and chunk merging info

                                    property chunks

                                    chunks?: boolean | undefined;
                                    • Add chunk information (setting this to false allows for a less verbose output)

                                    property chunksSort

                                    chunksSort?: string | undefined;
                                    • Sort the chunks by a field

                                    property context

                                    context?: string | undefined;
                                    • Context directory for request shortening

                                    property depth

                                    depth?: boolean | undefined;
                                    • Display the distance from the entry point for each module

                                    property entrypoints

                                    entrypoints?: boolean | undefined;
                                    • Display the entry points with the corresponding bundles

                                    property env

                                    env?: boolean | undefined;
                                    • Add --env information

                                    property errorDetails

                                    errorDetails?: boolean | undefined;
                                    • Add details to errors (like resolving log)

                                    property errors

                                    errors?: boolean | undefined;
                                    • Add errors

                                    property exclude

                                    exclude?: StatsExcludeFilter | undefined;
                                    • See excludeModules

                                    property excludeAssets

                                    excludeAssets?: StatsExcludeFilter | undefined;
                                    • Exclude assets from being displayed in stats

                                    property excludeModules

                                    excludeModules?: StatsExcludeFilter | undefined;
                                    • Exclude modules from being displayed in stats

                                    property hash

                                    hash?: boolean | undefined;
                                    • Add the hash of the compilation

                                    property maxModules

                                    maxModules?: number | undefined;
                                    • Set the maximum number of modules to be shown

                                    property modules

                                    modules?: boolean | undefined;
                                    • Add built modules information

                                    property modulesSort

                                    modulesSort?: string | undefined;
                                    • Sort the modules by a field

                                    property moduleTrace

                                    moduleTrace?: boolean | undefined;
                                    • Show dependencies and origin of warnings/errors

                                    property performance

                                    performance?: boolean | undefined;
                                    • Show performance hint when file size exceeds performance.maxAssetSize

                                    property providedExports

                                    providedExports?: boolean | undefined;
                                    • Show the exports of the modules

                                    property publicPath

                                    publicPath?: boolean | undefined;
                                    • Add public path information

                                    property reasons

                                    reasons?: boolean | undefined;
                                    • Add information about the reasons why modules are included

                                    property source

                                    source?: boolean | undefined;
                                    • Add the source code of modules

                                    property timings

                                    timings?: boolean | undefined;
                                    • Add timing information

                                    property usedExports

                                    usedExports?: boolean | undefined;
                                    • Show which exports of a module are used

                                    property version

                                    version?: boolean | undefined;
                                    • Add webpack version information

                                    property warnings

                                    warnings?: boolean | undefined;
                                    • Add warnings

                                    property warningsFilter

                                    | string
                                    | RegExp
                                    | Array<string | RegExp>
                                    | ((warning: string) => boolean)
                                    | undefined;
                                    • Filter warnings to be shown

                                    type Preset

                                    type Preset =
                                    | boolean
                                    | 'errors-only'
                                    | 'errors-warnings'
                                    | 'minimal'
                                    | 'none'
                                    | 'normal'
                                    | 'verbose';

                                      type StatsExcludeFilter

                                      type StatsExcludeFilter =
                                      | string
                                      | string[]
                                      | RegExp
                                      | RegExp[]
                                      | ((assetName: string) => boolean)
                                      | Array<(assetName: string) => boolean>;

                                        type ToJsonOptions

                                        type ToJsonOptions = Preset | ToJsonOptionsObject;

                                          Package Files (1)

                                          Dependencies (3)

                                          Dev Dependencies (0)

                                          No dev dependencies.

                                          Peer Dependencies (0)

                                          No peer dependencies.


                                          To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                          You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/webpack-bundle-analyzer.

                                          • Markdown
                                          • HTML
                                            <a href="https://www.jsdocs.io/package/@types/webpack-bundle-analyzer"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>