A framework-agnostic Vite plugin inspired by Laravel's Vite plugin.
  • TypeScript 100%
Find a file
2025-10-28 14:09:14 +04:00
.github/workflows chore(deps): update oven-sh/setup-bun action to v2 (#5) 2025-10-12 16:22:19 +04:00
examples feat: initial commit 2025-10-11 00:43:57 +04:00
.gitignore feat: initial commit 2025-10-11 00:43:57 +04:00
.npmignore feat: initial commit 2025-10-11 00:43:57 +04:00
biome.json feat: initial commit 2025-10-11 00:43:57 +04:00
bun.lock feat: initial commit 2025-10-11 00:43:57 +04:00
index.ts feat: initial commit 2025-10-11 00:43:57 +04:00
LICENSE feat: initial commit 2025-10-11 00:43:57 +04:00
package.json v1.0.3 2025-10-28 14:09:14 +04:00
README.md feat: initial commit 2025-10-11 00:43:57 +04:00
renovate.json chore: add renovate.json (#1) 2025-10-11 00:45:31 +04:00
tsconfig.json feat: initial commit 2025-10-11 00:43:57 +04:00
vite.config.ts feat: initial commit 2025-10-11 00:43:57 +04:00

vite-hmr

A framework-agnostic Vite plugin inspired by Laravel's Vite plugin.

Installation

npm install vite-hmr

Usage

// vite.config.ts
import { defineConfig } from 'vite'
import hmr from 'vite-hmr'

export default defineConfig({
  plugins: [
    hmr({
      input: ['src/js/main.ts', 'src/css/app.css'],
      refresh: true,
    }),
  ],
})

Configuration

Option Type Default Description
input string[] | Record<string, string> [] Entry points to compile
publicDir string "public" Directory for public assets
buildDir string "build" Output directory inside publicDir
hotFile string "public/hot" Path to hot reload file
refresh boolean | string | string[] false Enable full-page reload on file changes

Output Structure

Built files are organized into:

  • js/ - JavaScript entry points and chunks
  • css/ - Stylesheets
  • images/ - Image assets
  • assets/ - Other assets

License

MIT