Fable, invoke F# from JS

…衆ロ難τιáo~ 提交于 2019-12-11 22:03:31

问题


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:


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.



来源:https://stackoverflow.com/questions/53704648/fable-invoke-f-from-js

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!