1
votes

I see a lot of documentation on F# JS interop and how to use JS code from F#, but I am trying to do the opposite: Call some of my F# code from (inlined) JS. I cannot find any information regarding this. Is it possible? If so how?

1

1 Answers

1
votes

So after 2 weeks of trying everything I could think about, google every word combination I could think of and creating a SO account to ask for help: I finally found how to do this.

It turns out I needed to add this to my webpack config's output section:

libraryTarget: 'var', library: 'EntryPoint'

as explained here: https://itnext.io/calling-a-es6-webpacked-class-from-outside-js-scope-f36dc77ea130

As it turns out this is not related to F#, fable or babel but to webpack.