Skip to content

Commit 6beb4c1

Browse files
author
Maxime Mangel
committed
Add notes about Fable bindings not needing the sources files
1 parent 71ee465 commit 6beb4c1

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

docs/docs/your-fable-project/author-a-fable-library.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,20 @@ To write a library that can be used in Fable you need to fulfill a few condition
1111
- Keep a simple `.fsproj` file: don't use MSBuild conditions or similar.
1212
- Include the source files in the Nuget package in a folder named `fable`.
1313

14-
The last point may sound complicated but it's only a matter of adding a couple of lines to your project file and let the `dotnet pack` command do all the rest.
14+
:::info
15+
If your library is a pure binding, you can skip this step.
1516

16-
```xml
17-
<!-- Add source files to "fable" folder in Nuget package -->
18-
<ItemGroup>
19-
<Content Include="*.fsproj; **\*.fs; **\*.fsi" PackagePath="fable\" />
20-
</ItemGroup>
21-
```
17+
This will improve Fable compilation time as the compiler will not need to parse the source files of the binding.
18+
:::
19+
20+
Add the following to your `.fsproj` file:
21+
22+
```xml
23+
<!-- Add source files to "fable" folder in Nuget package -->
24+
<ItemGroup>
25+
<Content Include="*.fsproj; **\*.fs; **\*.fsi" PackagePath="fable\" />
26+
</ItemGroup>
27+
```
2228

2329
In order to publish the package to Nuget check [the Microsoft documentation](https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package-using-the-dotnet-cli) or alternatively you can also [use Fake](https://fake.build/dotnet-nuget.html#Creating-NuGet-packages).
2430

0 commit comments

Comments
 (0)