Skip to content

Latest commit

 

History

History
38 lines (27 loc) · 906 Bytes

readme.md

File metadata and controls

38 lines (27 loc) · 906 Bytes

vite-plugin-bundle-monitoring

npm i -D vite-plugin-bundle-monitoring

Plugin for vite to monitor changes in bundle size.

Executed after the build is complete and compares the current files with the previous ones. img.png

Get start

To use, you just need to add it to plugins in Vite config

import VitePluginBundleMonitoring from 'vite-plugin-bundle-monitoring';


export default defineConfig({
    plugins: [
        VitePluginBundleMonitoring({
            compareFileDir: path.resolve(__dirname, 'compare'),
        }),
    ],
})

If you want the size to be calculated from new data, simply delete or move the old data to another location.

PluginOptions

type VitePluginBundleMonitoringOptions = {
    compareFileDir?: string;   // default: __dirname
    compareFileName?: string;  // default: vite-bundle-monitoring.compare.json
}