Templates for Fable projects maintained by fable-compiler org
To create a new minimal Fable project:
dotnet new -i Fable.Template
dotnet new fable -n <name-of-your-project>
Name | Short Name | Description |
---|---|---|
Fable.Template | fable | Small Fable app project, with the only dependency on Fable.Browser.Dom |
-
Package the template by running
dotnet pack -c Release minimal/Fable.Template.proj
-
Install the new version of the template:
dotnet new i minimal/bin/Release/Fable.Template.x.y.z.nupkg
-
Create the template:
dotnet new fable -n <name-of-your-project>
.If you are using gitpod to contribute, add
--gitpod
at the end -
cd <name-of-your-project>
-
Follow the instructions from the README.md of the installed template
- Your NuGet API key set in
NUGET_KEY
variable.
To publish a new version of the template you need to:
- Update the changelog of the template you want to publish
- Run
dotnet tool restore
- Run
dotnet fake build -t Release
In the webpack.config.js, we are adding things like:
//#if( gitpod )
const execSync = require('child_process').execSync;
var isGitPod = process.env.GITPOD_INSTANCE_ID !== undefined;
function getDevServerUrl() {
if (isGitPod) {
const url = execSync('gp url 8080');
return url.toString().trim();
} else {
return `http://localhost:${CONFIG.devServerPort}`;
}
}
//#endif
The code between //#if( gitpod )
and //#endif
is not included in the generated template. It's here so people can use Gitpod to contribute to this repository.