Skip to content

Vite plugin for FastHTML/MonsterUI that automates installation & building

License

Notifications You must be signed in to change notification settings

AnswerDotAI/fhvite

Repository files navigation

fhvite

Usage

Installation

Install the latest version from pypi:

pip install fhvite

How to use

Import into an existing FastHTML application and add the following:

from fasthtml.common import *

# Add this import
from fhvite.core import add_vite

app = FastHTML()

# Add this line
add_vite(app)

All necessary setup files will be generated if not already present. After that, subsequent server starts will simply build the assets and inject them into the app header.

The plugin function also mounts a FastHTML StaticNoCache(directory=pwd/'dist') route pointing to the output folder. This ensures the generated assets benefit from modern cacheing/ asset serving behaviour automatically.

About

Vite plugin for FastHTML/MonsterUI that automates installation & building

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •