1
votes

I am experimenting with F# and using Fable to compile to JavaScript. The story is good so far. However, I have projects that do not use Webpack bundler where I wish to use Fable. NPM module fable-compiler does not expose any CLI command to compile simple .fs file to a .js file.

I wonder if this is possible. If yes, how? Basically, I need a plain output like the way Fable REPL produces i.e. distinct .js file side-by-side for each .fs file.

Ideally, I assume it should be similar to BuckleScript/Reason compiler but I could not find any documentation so far.

1

1 Answers

3
votes

You can do this by using the fable-splitter package instead of fable-compiler.

Using this is as simple as fable-splitter myProject.fsproj -o outputDir

A sample project using this approach can be found here.