oc-vite is a modified fork of Vite that enables external asset support in library mode. Current stable version is 7.1.12. It follows Vite's release cadence and provides all Vite 7 features plus custom asset handling for library builds. The key differentiator is allowing users to configure external assets (e.g., images, fonts) as separate files instead of inlining them, which is useful for library authors publishing to npm. It ships TypeScript declarations and requires Node ^20.19.0 or >=22.12.0. Compared to standard Vite, oc-vite adds a specific hook or configuration option for library assets; otherwise identical to Vite in API and behavior.
npm install oc-viteVerified import paths — ran on the pinned version, not inferred.
Demonstrates a basic Vite library configuration with external dependencies and multiple output formats.
Switch to ESM imports (import { ... } from 'vite') or use dynamic import().Append file extensions e.g., import data from './data.json' with { assert: { type: 'json' } }.Wrap values in JSON.stringify() to avoid syntax errors, e.g., __APP_VERSION__: JSON.stringify('1.0.0').Use `optimizeDeps.include` and `optimizeDeps.exclude` explicitly instead.
npm install vue@^3.2.13 or yarn add vue@^3.2.13.
Delete node_modules and package-lock.json, then run 'npm install' again. Alternatively, reinstall esbuild: 'npm rebuild esbuild'.
Run 'npm install vite' or 'yarn add vite'.
Ensure 'react/jsx-runtime' is installed (available in React 17+). Add to 'optimizeDeps.include' if needed.
No dependency data recorded yet.