rollup-plugin-visualizer

  • Version 7.1.1
  • Published
  • 2.3 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 your bundle to quickly see which modules are taking up space.

Index

Functions

function visualizer

visualizer: (
opts?:
| PluginVisualizerOptions
| ((outputOptions: BundlerOutputOptions) => PluginVisualizerOptions)
) => VisualizerPlugin;

    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.

              "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 generated file. Ignored when json or emitFile is true.

              false

            property openOptions

            openOptions?: OpenOptions;

              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. '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 (38)

                    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>