How to open Modules from other files in Fable-F#

204 views Asked by At

I'm brand new to Fable and I'm having some issues opening a custom module from a different file.

Here's my basic file setup

node_modules
 |
public
 |
src 
 |_ App.fsx
 |_ OtherFile.fsx

Inside the App.fsx file:

open CustomModule

Inside the OtherFile.fsx file

module CustomModule =

    let greeting = 
        printfn "hello from CustomModule"

Here is my fableconfig.json file:

{
    "projFile": "./src/App.fsx", 
    "outDir": "./public",
    "scripts": {
        "postbuild": "./node_modules/.bin/webpack"
    }

}

Whenever I try to reference CustomModule, I get a The namespace or module 'CustomModule' is not defined. error. Any ideas?

1

There are 1 answers

0
Nathan Ortega On BEST ANSWER

Turns out there was a similar question here, whose answer solved my issue.

Just call the following to load other modules

#load "OtherFile.fsx"