Seamlessly Integrate Vite with Your Java Web Applications
- 🌐 Custom JSP tags for Vite assets
- ⚙️ Asset import utilities
- 🔄 Dev and prod support
- 📁 Seamless configuration
- 💻 Spring MVC (JSP & Thymeleaf) support
JaVite (pronounced "jah-vite") is a module designed to integrate Vite with Java web applications, focusing on legacy Spring MVC projects and Thymeleaf templates. It allows developers to modernize their front-end assets using Vite's powerful bundling capabilities while seamlessly incorporating these assets into traditional Java web applications.
To include JaVite in your project, add the following dependency to your build.gradle
file:
dependencies {
implementation 'com.javite:javite-webmvc:0.1.6'
}
For Maven, add the following to your pom.xml
:
<dependency>
<groupId>com.javite</groupId>
<artifactId>javite-webmvc</artifactId>
<version>0.1.6</version>
</dependency>
-
Add the custom tag to your JSP files:
<%@ taglib prefix="vite" uri="https://javite.com/tags" %>
-
Use the custom tags to import Vite-generated assets:
<vite:import entry="/main.ts"/>
JaVite uses a configuration class to determine the environment and asset paths. By default, it looks
for your application.properties
(or application.yml
) file:
vite.debug=true
vite.manifest-path=/WEB-INF/dist/.vite/manifest.json
vite.local-server-url=http://localhost:5173
vite.resource-path=/resources
Contributions are welcome! Please submit a pull request or open an issue for any bugs or feature requests.
This project is licensed under the MIT License. See the LICENSE file for details.
This project was inspired by the following resources:
For more detailed documentation, please visit JaVite Documentation.