rollup-plugin-visualizer

  • Version 7.3.0
  • Published
  • 2.72 MB
  • 4 dependencies
  • MIT license

Install

npm i rollup-plugin-visualizer
yarn add rollup-plugin-visualizer
pnpm add rollup-plugin-visualizer

Overview

Visualize and analyze bundle sizes and module dependencies in Rollup, Rolldown, and Vite.

Index

Functions

function visualizer

visualizer: {
(pluginOptions?: PluginVisualizerOptions): VisualizerPlugin;
(
pluginOptions: (
outputOptions: BundlerOutputOptions
) => PluginVisualizerOptions
): VisualizerPlugin;
(
pluginOptions?:
| PluginVisualizerOptions
| ((outputOptions: BundlerOutputOptions) => PluginVisualizerOptions)
): VisualizerPlugin;
};
  • Deprecated

    Pass an options object instead of a function.

Interfaces

interface BundlerOutputOptions

interface BundlerOutputOptions {}
  • Only the members this plugin reads; see the note above about widening.

property dir

dir?: string;

    property file

    file?: string;

      property sourcemap

      sourcemap?: boolean | 'inline' | 'hidden';

        interface PluginVisualizerOptions

        interface PluginVisualizerOptions {}

          property brotliSize

          brotliSize?: boolean;
          • If plugin should also calculate sizes of brotlied files.

            false

          property emitFile

          emitFile?: boolean;
          • Use rollup .emitFile API to generate files. Could be usefull if you want to output to configured by rollup output dir. When this set to true, filename options must be filename and not a path.

            false

          property exclude

          exclude?: Filter | Filter[];
          • A valid picomatch pattern, or array of patterns. If options.include is omitted or has zero length, filter will return true by default. Otherwise, an ID must match one or more of the picomatch patterns, and must not match any of the options.exclude patterns.

          property filename

          filename?: string;
          • The path to the template file to use. Or just a name of a file.

            Ignored with output: "link".

            "stats.html"

          property gzipSize

          gzipSize?: boolean;
          • If plugin should also calculate sizes of gzipped files.

            false

          property include

          include?: Filter | Filter[];
          • A valid picomatch pattern, or array of patterns. If options.include is omitted or has zero length, filter will return true by default. Otherwise, an ID must match one or more of the picomatch patterns, and must not match any of the options.exclude patterns.

          property json

          json?: boolean;
          • If plugin should emit json file with visualizer data. It can be used with plugin CLI

            false

            Deprecated

            use template 'raw-data'

          property open

          open?: boolean;
          • If plugin should open browser with the generated file or report link. Ignored when json or emitFile is true.

            false

          property openOptions

          openOptions?: OpenOptions;

            property output

            output?: 'file' | 'link';
            • Write a report file (default), or print a complete static viewer URL.

            property projectRoot

            projectRoot?: string | RegExp;
            • Absolute path where project is located. It is used to cut prefix from file's paths.

              process.cwd()

            property sourcemap

            sourcemap?: boolean;
            • If plugin should use sourcemap to calculate sizes of modules. By idea it will present more accurate results. gzipSize and brotliSize does not make much sense with this option.

              false

            property template

            template?: TemplateType;
            • Which diagram to generate. 'sunburst' or 'treemap' can help find big dependencies or if they are repeated. 'treemap-3d' renders the same hierarchy as extruded boxes with a 3D camera. 'treemap-v2' adds a docked inspector for sizes, imports, and importers. 'network' can answer you why something was included. 'flamegraph' will be familar to tools that you know already. 'markdown' generates text report with notes about precision and config.

              'treemap'

            property title

            title?: string;
            • HTML value in generated file. Ignored when json is true.

              "Rollup Visualizer"

            interface VisualizerPlugin

            interface VisualizerPlugin {}

              property name

              name: string;

                method generateBundle

                generateBundle: (
                this: BundlerPluginContext,
                outputOptions: BundlerNormalizedOutputOptions,
                outputBundle: BundlerOutputBundle
                ) => Promise<void>;

                  Package Files (2)

                  Dependencies (4)

                  Dev Dependencies (41)

                  Peer Dependencies (2)

                  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/rollup-plugin-visualizer.

                  • Markdown
                    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/rollup-plugin-visualizer)
                  • HTML
                    <a href="https://www.jsdocs.io/package/rollup-plugin-visualizer"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>