Jlll1 / Sutil-Template

Set of `dotnet new` templates for creating Sutil applications
MIT License
1 stars 2 forks source link

Fable generates JS files next to FS #8

Open DejanMilicic opened 2 years ago

DejanMilicic commented 2 years ago

When running a project generated with the Sutil-Safe template, F# files were compiled to JS, and those JS files were placed right next to their F# files

I do not know what the best practice is, but I think so far, I saw solution where separate output folder is generated

Jlll1 commented 2 years ago

Hi! Thank you for your issue!

Definitely, these files would be better placed in a separate build directory. You can achieve that by passing -o <output_path> to fable watch in Build.fs

https://github.com/Jlll1/Sutil-Template/blob/2e9544eb80314079c79c7688ee244e32d40bc019/templates/Sutil-Safe/Build.fs#L60-L64

After that is done, all paths in webpack.config.js would need to be updated to match the new output directory.

If you want, feel free to open a PR for this. If not I'll clean this up when I find some free time :) Cheers.

DejanMilicic commented 2 years ago

I made changes to a Sutil-Safe project scaffolded from template and verified it works fine. Now, before I create a PR, can you please instruct me how to build template locally and use it from the local? Thanx!

DejanMilicic commented 2 years ago

OK, just went, did some reading, and figured out templates are just normal projects with a special folder :) https://learn.microsoft.com/en-us/dotnet/core/tools/custom-templates#source-files-and-folders

DejanMilicic commented 2 years ago

PR created https://github.com/Jlll1/Sutil-Template/pull/10 Please review, and correct if needed, then I can propagate it to a smaller template as well