Skip to content

Repository demonstrating how to import npm packages into Fable code

Notifications You must be signed in to change notification settings

CompositionalIT/fable-npm-imports-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fable imports demo

  • Run dotnet tool restore to install fable as a repository-local dotnet tool.
  • Run npm install to install npm packages.
  • Run dotnet fable watch import.fsx --sourceMaps --run npx vite to:
    • 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.js so 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).

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.

About

Repository demonstrating how to import npm packages into Fable code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published