last update: 2021-09-27
You can use Typescript for NPM package glue to FSharp Code. You don't need to use ts2fable
. Just write type informations as you need on fs
. Enjoy @types
of NPM packages in Typescript without hassle.
And Goodbye to Dinosaur webpack.config.js
.
Click Use this template
button on GitHub Repository Site
// App.fs
open Fable.Core
// Member imports
// import { alertPass } from "./usets"
// Same as Import("alertPass", "./usets")
[<Import("alertPass", from = "./usets")>]
let alertPass (msg1: string) (msg2: string) : unit = jsNative
app.onclick <- fun _ -> alertPass "123" "abc"
// usets.ts
function alertPass(msg1: string, msg2: string) {
alert(`msg1: ${msg1}\nmsg2: ${msg2}`);
}
export { alertPass };
Check more information on Fable document.
dev
: start dev serverbuild
: build for productionserve
: locally preview production build
postinstall
: install dotnet tools (automatically called afternpm install
)
From Fable.Lit
format
: format*.fs
files using fantomas
trashfsjs
: trash*.fs.js
files insrc