Fable F #> js compiles multiple .fsx files

How to compile multiple files .fsxusing Fable?

I (naively) tried to just pass an array from the fable.config file as follows:

{
    "outDir": "app",
    "projFile":["app/index.fsx", "app/testmod.fsx"],
    "sourceMaps": true,
    "targets": {
        "production": {
            "sourceMaps": false
        }
    }
}

but get a warning:

ARG ERROR: TypeError: Path must be a string. Received [ 'app/index.fsx', 'app/testmod.fsx' ]

I know that I can make a full-blown .fsproj file and point it to a fable compiler, but it seems too complicated to add a link.

Does it seem like I'm missing something really simple?

+4
source share
1 answer

Well, I really missed something simple!

Actually a very simple solution is to just use the link in the file .fsxand not worry about specifying Fable in the link file.

index.fsx:

module App

#load "testmod.fsx" //this reference is all thats needed!

fable.config:

{
    "outDir": "app",
    "projFile":"app/index.fsx",
    "sourceMaps": true,
    "targets": {
        "production": {
            "sourceMaps": false
        }
    }
}

Stack Overflow!

+7

Source: https://habr.com/ru/post/1656694/


All Articles