Commands

fable

Run Fable in release mode, RELEASE compiler directive will be set.

fable watch

Run Fable in watch mode, DEBUG compiler directive will be set.

let host =
    #if DEBUG
    "http://localhost:8080"
    #else
    "https://myapp.com"
    #endif

fable clean

Remove fable_modules folders and files with specified extensions (default .fs.js).

Options

OptionsDescription

--cwd

Working directory

-o|--outDir

Redirect compilation output to a directory

-e|--extension

Extension for generated JS files (default .fs.js)

-s|--sourceMaps

Enable source maps

--sourceMapsRoot

Set the value of the sourceRoot property in generated source maps

--define

Defines a symbol for use in conditional compilation

-c|--configuration

The configuration to use when parsing .fsproj with MSBuild, default is 'Debug' in watch mode, or 'Release' otherwise

--verbose

Print more info during compilation

--silent

Don't print any log during compilation

--typedArrays

Compile numeric arrays as JS typed arrays (default is true for JS, false for TS)

--watch

Alias of watch command

--watchDelay

Delay in ms before recompiling after a file changes (default 200)

--run

The command after the argument will be executed after compilation

--runFast

The command after the argument will be executed BEFORE compilation

--runWatch

Like run, but will execute after each watch compilation

--runScript

Runs the generated script for last file with node

(Requires "type": "module" in package.json and at minimum Node.js 12.20, 14.14, or 16.0.0)

--yes

Automatically reply 'yes' (e.g. with clean command)

--noRestore

Skip dotnet restore

--noCache

Recompile all files, including sources from packages

--exclude

Don't merge sources of referenced projects with specified pattern (Intended for plugin development)

--optimize

Compile with optimized F# AST (experimental)

--lang|--language

Choose wich languages to compile to

Available options:

  • javascript (alias js) - stable
  • typescript (alias ts) - stable
  • python (alias py) - beta
  • rust (alias rs) - beta
  • dart - beta
  • php - experimental

Default is javascript

Environment variables

DOTNET_USE_POLLING_FILE_WATCHER

When set to '1' or 'true', Fable watch will poll the file system for changes. This is required for some file systems, such as network shares, Docker mounted volumes, and other virtual file systems.