Fablelous Enterprise Tic-Tac-Toe
npm comes bundled with node.js, but we recommend to use at least npm 5. If you have npm installed, you can upgrade it by running
npm install -g npm.
Although is not a Fable requirement, on macOS and Linux you'll need Mono for other F# tooling like Paket or editor support.
The project can be used by editors compatible with the new .fsproj format, like VS Code + Ionide, Emacs with fsharp-mode or Rider. Visual Studio for Mac is also compatible but in the current version the package auto-restore function conflicts with Paket so you need to disable it:
Preferences > Nuget > General.
Building and running the app
In the commands below, yarn is the tool of choice. If you want to use npm, just replace
npmin the commands.
- Install JS dependencies:
- Move to
- Install F# dependencies:
- Start Fable daemon and Webpack dev server:
dotnet fable yarn-start
- In your browser, open: http://localhost:8080/
dotnet fable yarn-start(or
npm-start) is used to start the Fable daemon and run a script in package.json concurrently. It's a shortcut of
yarn-run [SCRIPT_NAME], e.g.
dotnet fable yarn-run start.
If you are using VS Code + Ionide, you can also use the key combination: Ctrl+Shift+B (Cmd+Shift+B on macOS) instead of typing the
dotnet fable yarn-start command. This also has the advantage that Fable-specific errors will be highlighted in the editor along with other F# errors.
Any modification you do to the F# code will be reflected in the web page after saving. When you want to output the JS code to disk, run
dotnet fable yarn-build and you'll get a minified JS bundle in the