Metadata-Version: 2.4
Name: fhvite
Version: 0.0.6
Summary: Vite plugin for FastHTML/MonsterUI that automates installation & building
Author-email: Curtis Allan <ca@answer.ai>
License-Expression: Apache-2.0
Project-URL: Repository, https://github.com/AnswerDotAI/fhvite
Project-URL: Documentation, https://AnswerDotAI.github.io/fhvite
Keywords: nbdev,jupyter,notebook,python
Classifier: Natural Language :: English
Classifier: Intended Audience :: Developers
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastcore
Requires-Dist: python-fasthtml>=0.14.6
Requires-Dist: pybun
Dynamic: license-file

# fhvite


<!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! -->

## Usage

### Installation

Install the latest version from pypi:

``` bash
pip install fhvite
```

## How to use

Import into an existing FastHTML application and add the following:

``` python
from fasthtml.common import *

# Add this import
from fhvite.core import add_vite

app = FastHTML()

# Add this line
add_vite(app)
```

At app startup, [`add_vite`](https://AnswerDotAI.github.io/fhvite/core.html#add_vite) creates missing setup files, runs `pybun install`, builds assets with `pybun run build` and adds the entry-point scripts and stylesheets to the app header. Installation follows the project’s lockfile.

For a prebuilt deployment, use `add_vite(app, run_build=False)`. It reads the existing manifest without creating setup files, installing dependencies or building. Both modes serve content-hashed build assets through FastHTML’s `StaticImmutable`.
