yesod-vite: An integration of vitejs with Yesod

[ bsd2, library, web, yesod ] [ Propose Tags ] [ Report a vulnerability ]

An integration of vite and yesod. Provides a typeclass YesodVite which enables the viteAsset tag to function.


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.2.0.0
Change log CHANGELOG.md
Dependencies aeson (>=2.2 && <2.3), base (>=4.21 && <4.22), bytestring (>=0.12 && <0.13), containers (>=0.7 && <0.8), text (>=2.1 && <2.2), yesod-core (>=1.6.27.0 && <1.7), yesod-static (>=1.6.1.0 && <1.7) [details]
License BSD-2-Clause
Copyright Ian Kollipara, 2026
Author Ian Kollipara
Maintainer ian.kollipara@gmail.com
Uploaded by ikollipara at 2026-04-17T10:59:09Z
Category Web, Yesod
Home page https://github.com/ikollipara/yesod-vite
Bug tracker https://github.com/ikollipara/yesod-vite/issues
Source repo head: git clone https://github.com/ikollipara/yesod-vite
Distributions
Downloads 16 total (9 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for yesod-vite-0.2.0.0

[back to package description]

yesod-vite

Yesod 💜 Vite.

This package provides an implement for the yesod web framework to connect with vite. Vite is a modern build tool used across stacks.

Quick Start

The assumption here is that your setup is similar to the default Yesod scaffold. You will need to have installed both yesod-static and yesod-vite for this to work. In addition, you will need the static subsite configured, as the route constructor is required.

  • Run npm init -y or the equivalent for your build tool.
  • Run npm i -D vite or the equivalent for your build tool.
  • Create a vite.config.js to include the following:
import { defineConfig } from "vite";
import * as path from "node:path";
export default defineConfig({
  plugins: [],
  base: "/static/",
  build: {
    outDir: path.resolve("./static"),
    manifest: "manifest.json",
    rollupOptions: {
      input: path.resolve("./assets/src/app.js"),
    },
  },
});
  • Install and configure "Yesod.Static" for your application.
  • Setup 'YesodVite' as the following:
instance YesodVite App where
  viteBuildDir :: app -> IO FilePath
  vitebuildDir app = return $ appStaticDir app
  viteInDev :: app -> IO Bool
  viteinDev app = return . const True
  viteRoute :: Route Static -> Route site
  viteRoute = StaticR
  • Add the viteAsset \<asset-name\> to your default layout.