Vite Preset
An opinionated Vite preset that bundles the configuration patterns used across personal projects: CSS Modules with mangled / camel / kebab class names, lightning-fast minification, library composition for monorepos, and chunking strategies for both apps and libraries.
Exports
preset— the main Vite plugin chain.composeLibrary— produces a Vite plugin that wires a workspace package into the host build.advancedAppChunk— chunk splitter that groups files bysrc/paths.advancedLibraryChunk— chunk splitter that groups files bynode_modules/paths.closeBundle— exits the Node process when the bundle finishes (useful in CI).- Pre-composed libraries —
flux,fluxApplication,fluxDashboard,fluxStatistics.
Quick example
ts
// vite.config.ts
import { defineConfig } from 'vite';
import { preset, flux } from '@basmilius/vite-preset';
export default defineConfig({
plugins: [
preset({
cssModules: {
classNames: 'camel',
prefix: 'app_'
},
fileNames: 'hashes'
}),
flux()
]
});