Skip to content

A Java module that integrates Vite for seamless asset management and modernization of legacy projects.

License

Notifications You must be signed in to change notification settings

javite-projects/javite

Repository files navigation

JaVite logo


Maven Central Build Status Javadoc


JaVite ⚡

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.

Installation

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>

Usage

JSP Integration

  1. Add the custom tag to your JSP files:

    <%@ taglib prefix="vite" uri="https://javite.com/tags" %>
  2. Use the custom tags to import Vite-generated assets:

    <vite:import entry="/main.ts"/>

Configuration

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

Contributing

Contributions are welcome! Please submit a pull request or open an issue for any bugs or feature requests.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Acknowledgements

This project was inspired by the following resources:

For more detailed documentation, please visit JaVite Documentation.

About

A Java module that integrates Vite for seamless asset management and modernization of legacy projects.

Resources

License

Code of conduct

Stars

Watchers

Forks

Languages