如何从 Fable-F# 中的其他文件打开模块
How to open Modules from other files in 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.
错误。有什么想法吗?
原来有一个类似的问题,他的回答解决了我的问题。
只需要调用下面的方法来加载其他模块
#load "OtherFile.fsx"
我是 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.
错误。有什么想法吗?
原来有一个类似的问题
只需要调用下面的方法来加载其他模块
#load "OtherFile.fsx"