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-bundleVerified import paths — ran on the pinned version, not inferred.
Configures Vite to build a library without bundling, preserving file structure and copying CSS assets.
Upgrade to Vite 5 or stay on plugin v3.x if using Vite 4.
Use Vite's built-in 'build.lib.fileName' option instead.
Switch to ESM imports or use dynamic import().
Use ESM format ('es') for library mode if static assets are needed.Set 'root' to the directory containing your entry point (e.g., 'lib' or 'src').
Upgrade to Vite 5 (npm install vite@latest) or downgrade plugin to v3.x.
Use default import: import noBundlePlugin from 'vite-plugin-no-bundle'
Install package (npm i -D vite-plugin-no-bundle) and use ESM import.