@types/webpack-bundle-analyzer

  • Version 4.6.3
  • Published
  • 9.15 kB
  • 3 dependencies
  • MIT license

Install

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

Overview

TypeScript definitions for webpack-bundle-analyzer

Index

Classes

class BundleAnalyzerPlugin

class BundleAnalyzerPlugin implements WebpackPluginInstance {}

    constructor

    constructor(options?: BundleAnalyzerPlugin.Options);

      property compiler

      compiler?: Compiler;

        property generateJSONReport

        generateJSONReport: (stats: WebpackStats) => Promise<void>;

        property generateStaticReport

        generateStaticReport: (stats: WebpackStats) => Promise<void>;

        property generateStatsFile

        generateStatsFile: (stats: WebpackStats) => Promise<void>;

          property getBundleDirFromCompiler

          getBundleDirFromCompiler: () => null | string;

            property opts

            opts: BundleAnalyzerPlugin.Options;

              property server

              server: any;

                property startAnalyzerServer

                startAnalyzerServer: (stats: WebpackStats) => Promise<void>;

                method apply

                apply: (compiler: Compiler) => void;

                  Namespaces

                  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. '127.0.0.1'

                                      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 analyzerUrl

                                      analyzerUrl?: (options: {
                                      listenPort: string;
                                      listenHost: string;
                                      boundAddress: AddressInfo;
                                      }) => string;
                                      • The URL printed to console with server mode. 'http://${listenHost}:${boundAddress.port}'

                                      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.ToJsonOptions | 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 {}

                                            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;

                                                  type ToJsonOptionsObject

                                                  type ToJsonOptionsObject = StatsOptions;

                                                    Package Files (1)

                                                    Dependencies (3)

                                                    Dev Dependencies (0)

                                                    No dev dependencies.

                                                    Peer Dependencies (0)

                                                    No peer dependencies.

                                                    Badge

                                                    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
                                                      [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/webpack-bundle-analyzer)
                                                    • 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>