Configuration
tsconfig.json
Section titled “tsconfig.json”Floe outputs TypeScript files, so your project needs a tsconfig.json. The floe init command creates one for you:
{ "compilerOptions": { "target": "ES2022", "module": "ESNext", "moduleResolution": "bundler", "jsx": "react-jsx", "strict": true, "skipLibCheck": true }, "include": ["src/**/*.ts", "src/**/*.tsx"]}Key settings:
jsx: "react-jsx"- required for.tsxoutput from Floe JSXstrict: true- matches Floe’s strictness philosophymoduleResolution: "bundler"- works with Vite and modern bundlers
Project Structure
Section titled “Project Structure”Recommended layout:
my-app/ src/ main.fl # Entry point components/ App.fl # React components Button.fl utils/ math.fl # Utility functions tsconfig.json package.json vite.config.ts # If using ViteBuild Output
Section titled “Build Output”By default, floe build outputs files next to the source:
src/main.fl -> src/main.tssrc/App.fl -> src/App.tsx (if JSX detected)Use --out-dir to specify a separate output directory:
floe build src/ --out-dir dist/npm Interop
Section titled “npm Interop”Floe resolves npm modules using your project’s tsconfig.json and node_modules. No additional configuration is needed.
When importing from npm packages:
T | nullbecomesOption<T>T | undefinedbecomesOption<T>anybecomesunknown
This happens automatically at the import boundary.
Ignoring Directories
Section titled “Ignoring Directories”The compiler automatically skips:
node_modules/- Hidden directories (
.git,.vscode, etc.) target/(Rust build output)