fable-compiler / fable3-samples

Nagareyama (Fable 3) samples
MIT License
48 stars 10 forks source link

Update interopFableFromJs sample (not working with serve yet though) #8

Closed delneg closed 3 years ago

delneg commented 3 years ago

Hello, I've tried updating interopFableFromJs sample like everything else but I can't get it to work with webpack serve If I build it using dotnet fable src --run webpack and serve files from public locally, everything is fine, however in 'dev-server' mode it doesn't work. Any ideas, @alfonsogarciacaro ?

alfonsogarciacaro commented 3 years ago

Hmm, this is strange. Using libraryTarget: "var" does expose MyFableLib globally but the exports are gone. Not sure if it's a Webpack issue, but since the example is just about interop with Fable from JS we can just use a separate JS file as entry and it works: https://github.com/fable-compiler/fable3-samples/commit/3aab064c84f4472a15e9b0efea7f3942ed2a02ed

image

delneg commented 3 years ago

I've cherry-picked the changes and can confirm that it works now. the PR is ready for merging

alfonsogarciacaro commented 3 years ago

Great, thank you!