Registry / devops / vite-plugin-no-bundle

vite-plugin-no-bundle

JSON →
library4.0.0jsnpmunverified

Vite plugin that enables building libraries without bundling, preserving the module structure for monorepos and native ESM consumption. Current stable version is 4.0.0 (requires Vite 5). The plugin marks all modules as external, copies static assets like CSS as-is, and supports multiple output formats (ESM, CJS). Released relatively actively with breaking changes in major versions. Differentiators: allows deep imports, consumer-side bundling, and tailored code splitting.

npm install vite-plugin-no-bundle
INSTALL
IMPORT
SIG · VITE-PLUGIN-NO-BUN
V
vite-plugin-no-bundle
devopsjavascriptv4.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.

default
import noBundlePlugin from 'vite-plugin-no-bundle'
const noBundlePlugin = require('vite-plugin-no-bundle')
Plugin is ESM-only since v3; CJS require will fail.
VitePluginNoBundleOptions
import type { VitePluginNoBundleOptions } from 'vite-plugin-no-bundle'
import { VitePluginNoBundleOptions } from 'vite-plugin-no-bundle'
Options type is exported as a type; use 'import type' in TypeScript.
noBundlePlugin
import noBundlePlugin from 'vite-plugin-no-bundle'
import { noBundlePlugin } from 'vite-plugin-no-bundle'
Default export only; named export does not exist.

Configures Vite to build a library without bundling, preserving file structure and copying CSS assets.

import { defineConfig } from 'vite'; import noBundlePlugin from 'vite-plugin-no-bundle'; export default defineConfig({ build: { lib: { formats: ['es'], entry: 'src/index.ts', }, }, plugins: [ noBundlePlugin({ copy: '**/*.css', internal: ['some/dependency'], root: 'src', }), ], });
Debug
Known issues
breakingv4.0.0 drops Vite 4 support, requires Vite 5.
fix
Upgrade to Vite 5 or stay on plugin v3.x if using Vite 4.
affects: <4.0.0
breakingv3.0.0 removes the 'fileNames' option in favor of 'build.lib.fileName'.
fix
Use Vite's built-in 'build.lib.fileName' option instead.
affects: <3.0.0
deprecatedThe plugin is ESM-only. CommonJS require() will throw Module not found or similar errors.
fix
Switch to ESM imports or use dynamic import().
affects: >=3.0.0
gotchaWhen using non-ESM output formats (e.g., CJS), static asset imports will break because import.meta.url is ESM-only.
fix
Use ESM format ('es') for library mode if static assets are needed.
affects: >=1.0.0
gotchaThe 'root' option must match your source folder (default 'src'). Misconfiguration leads to wrong relative paths in output.
fix
Set 'root' to the directory containing your entry point (e.g., 'lib' or 'src').
affects: >=1.0.0
Errors
Common errors & fixes
Error: The plugin 'vite-plugin-no-bundle' requires Vite version >=5.0.0. Current version: 4.x.x
Using plugin v4 with Vite 4.
fix
Upgrade to Vite 5 (npm install vite@latest) or downgrade plugin to v3.x.
TypeError: noBundlePlugin is not a function
Importing plugin incorrectly using named import.
fix
Use default import: import noBundlePlugin from 'vite-plugin-no-bundle'
Module not found: Can't resolve 'vite-plugin-no-bundle' in ...
Package not installed or CJS require() used with ESM-only package.
fix
Install package (npm i -D vite-plugin-no-bundle) and use ESM import.
Upgrade
Version history
4.0.0latest on npm
Audit
Dependencies
viterequiredPeer dependency: plugin requires Vite 5+ (v4 breaking change dropped Vite 4 support).
Agent activity
5 hits · last 30 days
node
4
Bingbot
1
Resources
vite-plugin-no-bundle — npm install vite-plugin-no-bundle · libregistry