PrincipleStudios.ViteDevelopmentServer 0.1.0

dotnet add package PrincipleStudios.ViteDevelopmentServer --version 0.1.0                
NuGet\Install-Package PrincipleStudios.ViteDevelopmentServer -Version 0.1.0                
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" />                
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                
#r "nuget: PrincipleStudios.ViteDevelopmentServer, 0.1.0"                
#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

// Install PrincipleStudios.ViteDevelopmentServer as a Cake Tool
#tool nuget:?package=PrincipleStudios.ViteDevelopmentServer&version=0.1.0                

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 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.

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 526 2/7/2024
0.1.0-preview.1 75 2/6/2024