Vite plugin to split vendor chunks
npm install split-vendor-chunk-plugin

A Vite plugin that automatically splits vendor chunks from node_modules into separate files. This helps optimize your build by:
- Improving caching efficiency
- Reducing main bundle size
- Enabling parallel loading of dependencies
``bash`
npm install split-vendor-chunk-plugin --save-dev
In your vite.config.js:
`javascript
import splitVendorChunkPlugin from 'split-vendor-chunk-plugin'
export default {
plugins: [
splitVendorChunkPlugin()
]
}
`
The plugin automatically detects imports from node_modules and splits them into separate chunks:
- Regular packages: node_modules/lodash → lodash-node_modules/@babel/core
- Scoped packages: → @babel/core-vendor-
- Other node_modules: grouped into
MIT © Roger Vilà