You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a short project file with less than 20 source files (pasted below). When I call webpack (npx webpack) it only compiles 3 of these files.
My intent is to provide a shared library of business logic and types between my back end code and my front end code. I'm not ready to go all in on rebuilding the front end in Fable, so I thought this would be an excellent timesaving proof of concept for code sharing.
As a note about the item references; I have been careful to keep this to types and purely logical functions (for example the references to the google API are for signatures of functions, but no calls to the API are made in this code). I don't know if this is going to cause me problems later on or not.
I would expect that all files listed in the project file would be compiled, instead only 3 are.
I know I'm probably doing something unexpected here, but I didn't know where else to get help, and most of the examples I am able to find are assuming you are building a full site in Fable, not just using the compiler to produce a JS library from F# so comparing setups is pretty hard for a beginner to Fable.
Related information
Fable version: 2.13.0
Operating system Windows 10
The text was updated successfully, but these errors were encountered:
you are using Fable 2 which is an old version of Fable.
You should try to use Fable 3, which comes as dotnet tool and write JS files directly on the disk.
Using Fable 3, would looks like that:
Install Fable: dotnet tool install fable
Run fable against your project: dotnet fable myProject.fsproj
This should compile all the F# files from your fsproj as File.fs.js, if you prefer to not have the JS files near the F# file you can use --outDir build to specify an output dir.
Edit:
Also, when using Fable 3, you don't need fable-loader anymore. You can just consome the generated file as if they were standard JavaScript file.
Thanks for checking @MangelMaxime and sorry for the late reply. There's also a sample PR here of upgrading a Fable 2 project in case it helps: MangelMaxime/fulma-demo#43
Description
I have a short project file with less than 20 source files (pasted below). When I call webpack (npx webpack) it only compiles 3 of these files.
My intent is to provide a shared library of business logic and types between my back end code and my front end code. I'm not ready to go all in on rebuilding the front end in Fable, so I thought this would be an excellent timesaving proof of concept for code sharing.
As a note about the item references; I have been careful to keep this to types and purely logical functions (for example the references to the google API are for signatures of functions, but no calls to the API are made in this code). I don't know if this is going to cause me problems later on or not.
Repro code
Project file:
Webpack config
Expected and actual results
I would expect that all files listed in the project file would be compiled, instead only 3 are.
I know I'm probably doing something unexpected here, but I didn't know where else to get help, and most of the examples I am able to find are assuming you are building a full site in Fable, not just using the compiler to produce a JS library from F# so comparing setups is pretty hard for a beginner to Fable.
Related information
The text was updated successfully, but these errors were encountered: