Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

vite-chunk-tools

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
One or more versions of this package were compromised as part of the ongoing “North Korea’s Contagious Interview Campaign” supply chain attack.

vite-chunk-tools

A Vite plugin for advanced chunk splitting and bundle optimization, helping improve caching, load performance, and maintainability in modern web projects.

latest
npmnpm
Version
1.0.3
Version published
Weekly downloads
94
Maintainers
1
Weekly downloads
 
Created
Source

vite-chunk-tools

npm version

vite-chunk-tools is a Vite config that makes it easy to control chunk splitting and bundle optimization. It helps you define custom chunk strategies, improve caching, and boost performance for modern, high-performance web applications.

Features

  • Flexible chunk splitting for vendor, framework, or custom modules
  • Smarter caching through stable and predictable chunk names
  • Reduce initial load time with optimized code splitting
  • Compatible with TypeScript and modern frontend frameworks
  • Works seamlessly with Vite’s build pipeline
  • Zero-config setup with sensible defaults, extendable with custom rules

Installation

Using npm:

npm install vite-chunk-tools --save-dev

Using Yarn:

yarn add vite-chunk-tools -D

Usage

Add the config to your vite.config.js or vite.config.ts:

import { defineConfig } from "vite";
import chunk from "vite-chunk-tools";

export default defineConfig({
  configs: [
    chunk({
      strategy: "manual",
      customSplits: {
        vendor: ["react", "react-dom"],
        utils: ["lodash", "axios"],
      },
    }),
  ],
});

Configuration Options

OptionTypeDefaultDescription
strategystring"default"Chunking strategy: "default", "manual", or "split-vendor"
customSplitsobject{}Define manual chunk groups (e.g., vendor, utils, etc.)
enableDiagnosticsbooleanfalseEnables detailed logs about chunking and performance metrics

Example Output

[vite-chunk-tools] 📦 Splitting vendor chunk: react, react-dom
[vite-chunk-tools] ✅ Generated 3 optimized chunks

License

MIT © [cent-fi]

Contributing

Have ideas or improvements? Contributions are welcome! Feel free to open an issue or submit a PR.

Keywords

vite

FAQs

Package last updated on 08 Oct 2025

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