如何从Fable-F中的其他文件打开模块#

时间:2017-09-14 18:36:50

标签: f# fable-f#

我是Fable的新手,我在使用其他文件打开自定义模块时遇到了一些问题。

这是我的基本文件设置

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

在App.fsx文件中:

open CustomModule

在OtherFile.fsx文件中

module CustomModule =

    let greeting = 
        printfn "hello from CustomModule"

这是我的fableconfig.json文件:

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

}

每当我尝试引用CustomModule时,都会出现The namespace or module 'CustomModule' is not defined.错误。有什么想法吗?

1 个答案:

答案 0 :(得分:0)

原来有一个类似的问题here,其答案解决了我的问题。

只需调用以下内容即可加载其他模块

Backbone.Model