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
presetThe main Vite plugin chain (CSS modules, minification, naming).composeLibraryWire a workspace package into the host build.advancedAppChunkChunk splitter that groups files by src/ paths.advancedLibraryChunkChunk splitter that groups files by node_modules/ paths.closeBundleExit the Node process when the bundle finishes (CI).Pre-composed librariesflux, 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()
]
});