@littlemissrobot/vite-plugin-highfive
v1.0.1
Published
A Vite plugin that adds support for Highfive, a contract-first TypeScript library for building applications with interchangeable services and shared conventions.
Maintainers
Readme
@littlemissrobot/vite-plugin-highfive
A tiny Vite plugin that enables decorator support for Highfive using Babel and Rolldown.
Installation
npm install @littlemissrobot/vite-plugin-highfiveUsage
Add highfive() to your Vite configuration:
import { defineConfig } from 'vite'
import highfive from '@littlemissrobot/vite-plugin-highfive'
export default defineConfig({
plugins: [
highfive(),
],
})That's it.
You can now use decorators required by Highfive in your Vite application.
What does it do?
Vite 8 uses Rolldown internally. Highfive relies on modern JavaScript decorators, which require an additional transform step.
This plugin configures @rolldown/plugin-babel with Babel's decorators transform using the 2023-11 decorators proposal:
babel({
presets: [
decoratorPreset({
version: '2023-11',
}),
],
})The Babel transform is only applied to source code containing @, avoiding unnecessary transforms for files that don't use decorators.
Requirements
- Vite 8+
- Node.js version supported by Vite 8
License
ISC
