vite-plugin-chai
v0.0.2
Published
Starter template for Vite Plugin library
Downloads
59
Maintainers
Readme
vite-plugin-chai
A vite plugin for better chunk splitting.
Install
#npm
npm install --save-dev vite-plugin-chai
#yarn
yarn add -D vite-plugin-chai
#pnpm
pnpm add -D vite-plugin-chai
Then you can use it in vite.config.ts
:
// vite.config.ts
import { defineConfig } from 'vite'
import Chai from 'vite-plugin-chai'
export default defineConfig({
plugins: [
Chai()
]
})
Options
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<string, packageInfo[]>;
export interface ChunkSplitOptions {
strategy?: Strategy;
customSplitting?: CustomSplitting;
}