vite-plugin-update-checker
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

vite-plugin-update-checker

A vite plugin to check for version of published html files.

Install

npm install --save-dev vite-plugin-update-checker

Usage

// vite.config.js
import { defineConfig } from "vite";
import { updateChecker } from "vite-plugin-update-checker";
export default defineConfig({
  plugins: [
    updateChecker({
      name: "version-name",
      from: "git",
      timeCell: 1000 * 60 * 60 * 2, // 2 hrs
      plainText: "version", // if you use "custom" or "random" in "from",you need to set this
    }),
  ],
});

Options

name

  • Type: string
  • Default: version
  • Description: The name of the meta tag.

from

  • Type: "package" | "git" | "random"|"custom"
  • Default: random
  • Description: The way to generate version.
  • Note: If you use "git" in "from",you must commit your code at least once.

timeCell

  • Type: number
  • Default: 1000 * 60 * 60 * 2
  • Description: The time interval to check your website version,and then reload the page.

plainText

  • Type: string
  • Default: Date.now().toString()
  • Description: The plain text to generate version,if you use "custom" in "from",you need to set this. if you use "random" in "from" and you set the same plainText,the version will be the same.

Readme

Keywords

none

Package Sidebar

Install

npm i vite-plugin-update-checker

Weekly Downloads

0

Version

1.0.4

License

MIT

Unpacked Size

6.89 kB

Total Files

7

Last publish

Collaborators

  • 3000-codes