Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 511 Bytes

README.md

File metadata and controls

31 lines (23 loc) · 511 Bytes

vite-vitals

Extend Vite with ability to send Core Web Vitals to Google Analytics.

Install

$ npm i -D vite-vitals

Setup

// vite.config.js
import vitals from 'vite-vitals'

export default {
  plugins:[vitals({
    // Tracking ID (required) { string }
    trackingID: 'UA-XXXXXXXX-X',
    // // Event Category (optional) { string }
    eventCategory: 'Vite Vitals',
    // Debug (optional) { boolean }
    debug: false
  })]
}

ToDo

  • detect if router is used