Socket
Book a DemoInstallSign in
Socket

vite-bundle-visualizer

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vite-bundle-visualizer

Visualize vite bundle

1.2.1
latest
Source
npmnpm
Version published
Weekly downloads
169K
-4.27%
Maintainers
1
Weekly downloads
 
Created

What is vite-bundle-visualizer?

The vite-bundle-visualizer npm package is a tool designed to help developers analyze and visualize the contents of their Vite project bundles. It provides insights into the size and composition of the bundle, helping to identify potential areas for optimization.

What are vite-bundle-visualizer's main functionalities?

Bundle Analysis

This feature allows you to generate a visual representation of your bundle. The code sample demonstrates how to configure the visualizer plugin in a Vite project to output the analysis to a file named 'stats.html' and automatically open it in the browser.

import { defineConfig } from 'vite';
import { visualizer } from 'vite-bundle-visualizer';

export default defineConfig({
  plugins: [
    visualizer({
      filename: './stats.html',
      open: true
    })
  ]
});

Custom Report Filename

This feature allows you to specify a custom filename for the generated report. The code sample shows how to set the filename to 'custom-report.html'.

import { defineConfig } from 'vite';
import { visualizer } from 'vite-bundle-visualizer';

export default defineConfig({
  plugins: [
    visualizer({
      filename: './custom-report.html'
    })
  ]
});

JSON Report

This feature enables the generation of a JSON report instead of an HTML file. The code sample demonstrates how to configure the visualizer to output the analysis in JSON format to 'stats.json'.

import { defineConfig } from 'vite';
import { visualizer } from 'vite-bundle-visualizer';

export default defineConfig({
  plugins: [
    visualizer({
      json: true,
      filename: './stats.json'
    })
  ]
});

Other packages similar to vite-bundle-visualizer

Keywords

vite

FAQs

Package last updated on 12 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.