- Run
dotnet tool restoreto install fable as a repository-local dotnet tool. - Run
npm installto install npm packages. - Run
dotnet fable watch import.fsx --sourceMaps --run npx viteto:- Transpile the code in import.fsx into import.fs.js, which is referred to from index.html (
dotnet fable import.fsx). - Have Fable automatically recompile when import.fsx is updated (
watch). - Generate
import.fs.jsso that you can add breakpoints to your F# code in the browser (--sourceMaps)! - Serve the assets from a local vite dev server once Fable compilation is finished (
--run npx vite).
- Transpile the code in import.fsx into import.fs.js, which is referred to from index.html (
Note: we'd usually make an F# project for production code. Check out the Feliz template (client-side only) or SAFE template (full stack) for more complete templates to kickstart your journey.