Vite Plugin
The vite-plugin-floe package lets Vite transform .fl files during development and production builds.
Installation
Section titled “Installation”npm install -D vite-plugin-floeMake sure floe is installed and available in your PATH.
Configuration
Section titled “Configuration”import { defineConfig } from "vite"import floe from "vite-plugin-floe"
export default defineConfig({ plugins: [floe()],})Options
Section titled “Options”floe({ // Path to the floe binary (default: "floe") compiler: "/usr/local/bin/floe",})How It Works
Section titled “How It Works”- Vite encounters a
.flimport - The plugin calls
floeto compile it to TypeScript - The TypeScript output is passed to Vite’s normal pipeline
- Hot Module Replacement works automatically
With React
Section titled “With React”import { defineConfig } from "vite"import react from "@vitejs/plugin-react"import floe from "vite-plugin-floe"
export default defineConfig({ plugins: [ floe(), // must come before React plugin react(), ],})File Structure
Section titled “File Structure”my-app/ src/ App.fl # Floe component utils.fl # Floe utilities legacy.tsx # Existing TypeScript (works alongside) vite.config.ts package.jsonFloe files and TypeScript files coexist. Adopt incrementally.