Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
V

vite-plugin-chunk-split

> 编程语言
Open source

A vite plugin for better chunk splitting. 一个简单易用的 Vite 拆包插件

392 stars0 likes2 views
WebsiteGitHub

About

vite-plugin-chunk-split

English | 中文

A vite plugin for better chunk splitting.

Usage

javascript
// use npm
npm i vite-plugin-chunk-split -D
// use yarn
yarn add vite-plugin-chunk-split -D
// use pnpm
pnpm i vite-plugin-chunk-split -D

Then you can use it in vite.config.ts:

typescript
// vite.config.ts
import { chunkSplitPlugin } from 'vite-plugin-chunk-split';

{
  plugins: [
    // ...
    chunkSplitPlugin()
  ]
}

Options

typescript
type packageInfo = string | RegExp;
type Strategy =
  // split by default
  | 'default'
  // all files will be together
  | 'all-in-one'
  // unbundle for your source files,vite will generate one chunk for every file
  | 'unbundle';

export type CustomSplitting = Record;

export interface ChunkSplitOptions {
  strategy?: Strategy;
  customSplitting?: CustomSplitting;
}

You can use the options to customize your splitting strategy, for example:

…

By the way, you can achieve bundleless by the unbundle strategy:

typescript
// vite.config.ts
import { chunkSplitPlugin } from 'vite-plugin-chunk-split';

{
  plugins: [
    // ...
    chunkSplitPlugin({
      strategy: 'unbundle',
      customSplitting: {
        // All files in `src/container` will be merged together in `container` chunk
        'container': [/src\/container/]
      }
    })
  ]
}

License

MIT

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScript

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言