How can I compile multiple .fsx
files using Fable?
I (naively) tried to just pass an array of them in the fable.config file like this:
{
"outDir": "app",
"projFile":["app/index.fsx", "app/testmod.fsx"],
"sourceMaps": true,
"targets": {
"production": {
"sourceMaps": false
}
}
}
but get the warning:
ARG ERROR: TypeError: Path must be a string. Received [ 'app/index.fsx', 'app/testmod.fsx' ]
I know I could make a full-blown .fsproj file and point the fable compiler to that but it seems like overkill to do this simply in order to add-in a reference.
It feels like I am missing something really simple?
Well, I really was missing something simple!
The really really straightforward solution is just to use a reference in the .fsx
file itself and don't worry about pointing Fable at the referenced file.
index.fsx:
module App
#load "testmod.fsx" //this reference is all thats needed!
Then we need no reference inside the fable.config:
{
"outDir": "app",
"projFile":"app/index.fsx",
"sourceMaps": true,
"targets": {
"production": {
"sourceMaps": false
}
}
}
Note to self - try the simplest solution first before posting on Stack Overflow!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With