TechGems.ViteDotNet
1.0.1
dotnet add package TechGems.ViteDotNet --version 1.0.1
NuGet\Install-Package TechGems.ViteDotNet -Version 1.0.1
<PackageReference Include="TechGems.ViteDotNet" Version="1.0.1" />
<PackageVersion Include="TechGems.ViteDotNet" Version="1.0.1" />
<PackageReference Include="TechGems.ViteDotNet" />
paket add TechGems.ViteDotNet --version 1.0.1
#r "nuget: TechGems.ViteDotNet, 1.0.1"
#:package TechGems.ViteDotNet@1.0.1
#addin nuget:?package=TechGems.ViteDotNet&version=1.0.1
#tool nuget:?package=TechGems.ViteDotNet&version=1.0.1
Vite.NET
Integrate Vite SPAs into ASP.NET Core Razor Pages and MVC — one build tool, shared authentication, and micro-frontends without leaving .NET.
📖 Full documentation: vite-dotnet.techgems.net
Vite.NET bridges a Vite-powered front end (React, Svelte, Vue, Solid) and an ASP.NET Core back end. Your SPA lives inside your .NET app, so it inherits your authentication, layouts, and static-file pipeline — while Vite gives you a fast dev server, hot module replacement, and optimized production bundles.
Upgrading from v0? v1 has breaking changes, but the upgrade is short: it removes nearly all backend configuration, since the Vite plugin now emits manifests describing each app. A handful of edits, covered step by step in Migrating from v0.
Why Vite.NET
- One build tool — Vite compiles your front end; ASP.NET Core serves it. No second server, no separate deployment.
- Zero-duplication config — the Vite plugin emits manifests describing each app, so the back end only needs the app's folder name. Everything else is generated.
- Shared authentication — because the SPA is served by your .NET app, it sits behind the same auth and cookies as the rest of your site.
- Micro-frontends — embed one SPA or many, each mounted into its own Razor page, all inside a single ASP.NET Core host.
How it fits together
An integration has three moving parts:
- A Vite plugin (
vite-dotnet) added to your SPA'svite.config.ts. It configures the build output and emits a small JSON manifest describing the app. - This NuGet package (
TechGems.ViteDotNet) registered in your ASP.NET Core app. It reads those manifests and exposes the tag helpers. - Two tag helpers —
<dev-vite-scripts>and<prod-vite-scripts>— that render the correct<script>/<link>tags into a Razor page for development or production.
Quick start
Register the integration in Program.cs:
builder.Services.AddViteIntegration(builder.Configuration);
Add the tag helpers in Pages/_ViewImports.cshtml:
@addTagHelper *, ViteDotNet
Tell the back end your SPA folder name in appsettings.json:
{
"ViteDotNet": "ReactApp"
}
Add the plugin in ReactApp/vite.config.ts:
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import ViteDotNetPlugin from 'vite-dotnet'
export default defineConfig({
plugins: [react(), ViteDotNetPlugin('src/main.tsx', 'root')],
})
Render the SPA in a Razor page — <dev-vite-scripts> in development, <prod-vite-scripts> in production:
<dev-vite-scripts app-name="ReactApp" />
With a single app configured you can omit app-name entirely. See the full Quick Start for the complete walkthrough, including the production build.
Learn more
- Overview — the full picture
- Installation — packages and setup
- How It Works — manifests and tag helpers under the hood
- Multiple SPAs — micro-frontends in one host
- Reference — plugin,
AddViteIntegration, tag helpers, and manifest files
Links
- Documentation: https://vite-dotnet.techgems.net
- GitHub: https://github.com/techgems/vite-dotnet
- License: MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Microsoft.AspNetCore.SpaServices.Extensions (>= 7.0.0)
- TechGems.StaticComponents (>= 1.4.0)
-
net7.0
- Microsoft.AspNetCore.SpaServices.Extensions (>= 7.0.0)
- TechGems.StaticComponents (>= 1.4.0)
-
net8.0
- Microsoft.AspNetCore.SpaServices.Extensions (>= 7.0.0)
- TechGems.StaticComponents (>= 1.4.0)
-
net9.0
- Microsoft.AspNetCore.SpaServices.Extensions (>= 7.0.0)
- TechGems.StaticComponents (>= 1.4.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 | |
|---|---|---|---|
| 1.0.1 | 146 | 9/9/2026 | |
| 1.0.0 | 157 | 8/18/2026 | |
| 1.0.0-beta | 140 | 8/17/2026 | |
| 0.1.1 | 80,634 | 11/25/2023 | |
| 0.1.0-beta | 582 | 1/6/2023 |
- Update to TechGems.StaticComponents 1.4.0