Lock files (like
package-lock.json if you're using npm) should be committed to ensure reproducible builds whenever anybody clones the repo.
Now we're ready, let's start a new project using Fable!
Use the official templates
Use Fable template
The easiest way to get starting with Fable is by using Fable official template.
dotnet new -i Fable.Template::*
dotnet new fable -n MyFirstFableProject
JS dependencies are listed in the
package.jsonfile. You can run
npm install, which will download the packages to the
node_modulesfolder and create a lock file.
.NET dependencies are listed in the
src/App.fsprojfile. You can install them by running
dotnet restore, but this is already automatically done by Fable.
Build & run the app
Now that we're done with the dependencies, let's start our app in watch mode.
npm startwhen the compilation is done, you'll be able to access your project from http://localhost:8080/ with your favorite browser.
If you now open the project with your code editor, you can make some changes in the
App.fsfile located in the
srcfolder. Save it and if the compilation succeeds you should be able to see your changes directly in your browser.