PrincipleStudios.ViteDevelopmentServer
0.1.0-preview.1
This is a prerelease version of PrincipleStudios.ViteDevelopmentServer.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package PrincipleStudios.ViteDevelopmentServer --version 0.1.0-preview.1
NuGet\Install-Package PrincipleStudios.ViteDevelopmentServer -Version 0.1.0-preview.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="PrincipleStudios.ViteDevelopmentServer" Version="0.1.0-preview.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add PrincipleStudios.ViteDevelopmentServer --version 0.1.0-preview.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: PrincipleStudios.ViteDevelopmentServer, 0.1.0-preview.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install PrincipleStudios.ViteDevelopmentServer as a Cake Addin #addin nuget:?package=PrincipleStudios.ViteDevelopmentServer&version=0.1.0-preview.1&prerelease // Install PrincipleStudios.ViteDevelopmentServer as a Cake Tool #tool nuget:?package=PrincipleStudios.ViteDevelopmentServer&version=0.1.0-preview.1&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
PrincipleStudios.ViteDevelopmentServer
A Vite development server for use with .NET Spa Services. This works very
similarly to the UseReactDevelopmentServer
middleware provided by the .NET Spa
Services project.
Note: This server is intended for development purposes only; it is not optimized for production.
Add your project reference to your csproj; be sure to exclude it for release builds:
<ItemGroup>
<PackageReference Include="PrincipleStudios.ViteDevelopmentServer" Version="0.1.0" Condition=" '$(Configuration)' == 'Debug' " />
</ItemGroup>
Usage:
app.UseSpa(spa => {
#if DEBUG
if (env.IsDevelopment())
{
spa.Options.SourcePath = "./path-to-react-source";
spa.UseViteDevelopmentServer(
// The bin path to run to launch the server from the SourcePath.
// This is typically "node_modules/.bin/vite", but if you wrap Vite
// a different path may be necessary
"node_modules/.bin/vite",
// Command line arguments to the script.
// `{port}` will be replaced with an unused port.
"--port {port}"
);
}
#endif
});
See the demo project for more details.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- Microsoft.AspNetCore.SpaServices.Extensions (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
0.1.0 | 535 | 2/7/2024 |
0.1.0-preview.1 | 75 | 2/6/2024 |