Pre-composed libraries
@basmilius/vite-preset ships with four composeLibrary factories pre-configured for the Flux ecosystem. Use them when consuming Flux from a workspace.
Importing
ts
import { flux, fluxApplication, fluxDashboard, fluxStatistics } from '@basmilius/vite-preset';Available libraries
| Factory | Package name | Alias |
|---|---|---|
flux | @flux-ui/components | ~flux/components |
fluxApplication | @flux-ui/application | ~flux/application |
fluxDashboard | @flux-ui/dashboard | ~flux/dashboard |
fluxStatistics | @flux-ui/statistics | ~flux/statistics |
Usage
ts
import { defineConfig } from 'vite';
import { flux, fluxApplication, preset } from '@basmilius/vite-preset';
export default defineConfig({
plugins: [
preset(),
flux(),
fluxApplication()
]
});After the first run the host tsconfig.json will gain paths entries for ~flux/components/*, ~flux/application/*, and so on. The unified ~flux/* namespace mounts each Flux package under its own sub-path, so import '~flux/components/button' and import '~flux/application/menu' are symmetric.
Roll your own
The factories are thin wrappers around composeLibrary. Wrap a workspace package the same way:
ts
import { composeLibrary } from '@basmilius/vite-preset';
export const myLibrary = composeLibrary({
name: '@my-org/library',
alias: '~myLib'
});See also
composeLibrary— the underlying factory.preset— the wider plugin chain.