If you are switching between languages make sure to delete the
fable_modules folder before invoking Fable again.
This guide you will show you how to create a Fable project from an F# project.
Create a new directory for your project and navigate to it.
mkdir my-fable-project cd my-fable-project
Create a new F# project.
dotnet new console -lang F#
You should now have 2 files:
Program.fs: the entry point of your app
my-fable-project.fsproj: the project file which lists your F# code files and libraries
Install Fable tool so we can invoke it from the command line.
dotnet new tool-manifest dotnet tool install fable
Add Fable.Core to your project.
dotnet add package Fable.Core
We can now call Fable to transpile our F# code to the desired target.
You should now see a file
You can now use this file as you would use any other native file in your project.
To go further look into the respective target documentation to have an example of how to use the generated file: