Vite.AspNetCore

screenshot of Vite.AspNetCore

Small library to integrate Vite into ASP.NET projects

Overview

Vite.AspNetCore is a powerful library designed to seamlessly integrate ViteJS into ASP.NET applications, making it an excellent choice for developers working with Multi-Page Applications (MPA). This library is compatible with popular frameworks such as MVC, Razor Pages, and Blazor Server, providing a reliable solution for managing assets and improving the development workflow. By leveraging Vite, it helps streamline the process of handling requests and serving assets, all while enhancing the overall performance of web applications.

Notably, Vite.AspNetCore brings a suite of features that simplify asset management and development. From middleware that proxies requests to tag helpers for effortless script and link management, it addresses common pain points faced by developers. Whether you are looking to enhance your asset delivery during development or improve your production environment's asset handling, this library has you covered.

Features

  • Middleware for Vite Development Server: Effortlessly forwards requests to the Vite Development Server, allowing access to assets using standard ASP.NET paths.

  • Vite Manifest Integration: Provides access to a JSON manifest for mapping original file names to their hashed versions, crucial for production environments.

  • Tag Helpers for Simplified Asset Management: Easy-to-use tag helpers for rendering scripts and styles with minimal configuration, optimizing the loading process based on the Vite Development Server's state.

  • Automatic Style Management: Automatically loads styles through scripts when the Vite Development Server is active, reducing the need for manual style inclusion.

  • Seamless Setup: Simple installation from NuGet and straightforward setup instructions to get started with minimal hassle.

  • Robust Environment Handling: Addresses common issues such as service workers testing and asset resolution, ensuring a smoother development experience.

  • Flexible Middleware Configuration: Offers customizable middleware settings, allowing developers to define the order, ensuring assets are served correctly.