1.0.10 • Published 10 months ago

vite-plugin-html-auto-reload v1.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

vite-plugin-html-auto-reload

a vite plugin to build with version and do auto reload html on version change

Install

# pnpm
pnpm add -D vite-plugin-html-auto-reload
# yarn
yarn add -D vite-plugin-html-auto-reload
# npm
npm i -D vite-plugin-html-auto-reload

Usage

// vite.config.js
import { defineConfig } from 'vite'
import htmlAutoReload from "vite-plugin-html-auto-reload"

export default defineConfig({
  plugins: [
    htmlAutoReload(),
  ],
})

Options

export type Options {
  /**
   * Whether to ask only once
   * @default true
   */
  once?: boolean;
  /**
   * Whether to get version on visibilitychange
   * @default true
   */
  onvisibilitychange?: boolean;
  /**
   * Whether to get version when load chunk error
   * @default true
   */
  onerror?: boolean;
  /**
   * Whether to poll to get version, and polling interval
   * polling interval time unit: ms, default 1000 * 60 ms
   * @default false
   */
  polling?: boolean | number;
}

Server Configuration

# nginx.conf

location ~* \.(html|htm)$ {
    add_header Cache-Control "no-cache, no-store, must-revalidate";
    add_header Pragma "no-cache";
    add_header Expires "0";
}
1.0.2

11 months ago

1.0.9

11 months ago

1.0.8

11 months ago

1.0.7

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.10

10 months ago

1.0.1

11 months ago

1.0.0

11 months ago