The compiler that emits JavaScript you can be proud of!
Fable brings together the power of the F# compiler and Babel to make JavaScript a true backend for F#. It works directly on F# source code, no compilation needed.
Fable optimizes F# code to generate as clean JavaScript as possible. It comes with a tiny core library (less than 10KB minified and gzipped) and no other runtime.
Fable uses Babel to generate source maps. It is compatible with Babel plugins and JavaScript tools, like Webpack, and organizes code using ES6 modules.
Fable supports most of the F# core library and a bit of .NET BCL. It interacts seamlessly with other JavaScript libraries. As a bonus, it compiles NUnit tests to Mocha!
A beta version has been released to npm! You can install and run it just by typing:
npm install -g fable-compiler fable path/to/your/file.fsx
Note the package name is fable-compiler
while the command is just fable
.
You must have F# 4.4 and node 4.4 or bigger installed in your computer.
You can find latest F# installation instructions on fsharp.org
(mac, windows).
To use the latest version, you can compile Fable from source
on GitHub.
Watch a brief introduction to Fable by the author of Fable. Learn how to configure Fable, run the Fable samples including Mario game and client-server React.js demo compiled using WebPack.
Fable comes with a growing list of samples ranging from browser games to server-side node applications. You can find the full list at samples page and you can add your own samples by sending a pull request.
Go to the Fable documentation page for more details. Is anything unclear or missing? Help us make Fable docs better by contributing!