Registry / split-vendor-chunk-plugin

split-vendor-chunk-plugin

JSON →
library7.0.0jsnpmunverified

A Vite plugin that automatically splits vendor chunks (node_modules imports) into separate files for improved caching and parallel loading. Current stable version: 7.0.0. The plugin groups node_modules imports into vendor chunks based on package name, with scoped packages handled separately. It is a lightweight alternative to manual Rollup/Vite manualChunks configuration. Release cadence is irregular but maintained.

npm install split-vendor-chunk-plugin
INSTALL
IMPORT
SIG · SPLIT-VENDOR-CHUNK
S
split-vendor-chunk-plugin
javascriptv7.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18223 runs
build_error
glibc
node 18223 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

splitVendorChunkPlugin
import splitVendorChunkPlugin from 'split-vendor-chunk-plugin'
const splitVendorChunkPlugin = require('split-vendor-chunk-plugin')
Default import is correct; ESM-only, no CommonJS export.
splitVendorChunkPlugin
plugins: [splitVendorChunkPlugin()]
plugins: [splitVendorChunkPlugin]
Call the function to return a plugin instance; do not pass the function reference directly.
splitVendorChunkPlugin
import { splitVendorChunkPlugin } from 'split-vendor-chunk-plugin'
import splitVendorChunkPlugin from 'split-vendor-chunk-plugin'
Only default export exists (v1-v7). Named export is a common mistake.

Basic Vite configuration using split-vendor-chunk-plugin to automatically split vendor chunks.

// vite.config.js import { defineConfig } from 'vite' import splitVendorChunkPlugin from 'split-vendor-chunk-plugin' export default defineConfig({ plugins: [ splitVendorChunkPlugin() ] })
Debug
Known issues
gotchaThe plugin does not respect Vite's `build.rollupOptions.output.manualChunks` – it applies its own chunk splitting which may conflict with user-defined manualChunks.
fix
Avoid setting manualChunks when using this plugin, or customize manually via manualChunks instead of using this plugin.
affects: >=1.0.0
gotchaScoped packages produce chunk names with '@' in filename, which may cause issues on some file systems or deployment servers (e.g., IIS).
fix
Use a custom chunk name function or replace '@' in filenames if deployment fails.
affects: >=1.0.0
deprecatedDeprecated: This plugin is effectively a wrapper around Vite's built-in `build.rollupOptions.output.manualChunks`. Since Vite 4+, consider using manualChunks directly for better control.
fix
Replace with Vite's manualChunks: `build: { rollupOptions: { output: { manualChunks(id) { if (id.includes('node_modules')) return 'vendor' } } } }`
affects: >=7.0.0
Errors
Common errors & fixes
TypeError: splitVendorChunkPlugin is not a function
Using require instead of import (CJS) or forgetting to call the plugin function (e.g., passing reference directly).
fix
Use ESM import: `import splitVendorChunkPlugin from 'split-vendor-chunk-plugin'` and call it: `plugins: [splitVendorChunkPlugin()]`
The plugin 'vite:split-vendor-chunk' has already been added
Adding the plugin multiple times in the plugins array.
fix
Include `splitVendorChunkPlugin()` only once.
Error: ENOENT: no such file or directory, open '.../dist/assets/vendor-xxxxx.js.map'
Source map issue when chunk name contains characters like '@' or parentheses from scoped packages.
fix
Disable source maps or configure clean chunk names: e.g., replace '@' with '_' in manualChunks.
Upgrade
Version history
7.0.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Bingbot
1
Resources