vite-plugin-build-monitoring
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

vite-plugin-build-monitoring

Monitor ram Memory when building, bundle sizing output and node_modules sizing Ideal for CI Checks and warning

Capture d’écran 2023-02-28 à 12 02 30

Install

npm install vite-plugin-build-monitoring

Usage

import monitorPlugin from 'vite-plugin-build-monitoring';

// configure it

const monitor = monitoring({
    BUNDLE_MAX_SIZE: 12,
    NB_NODE_MODULES_MAX: 148,
    MEMORY_WARNING_MAX_SIZE: 2500,
    NODE_MODULES_MAX_SIZE: 1000,
    MEMORY_ERROR_MAX_SIZE: 3000,
  }),

// then add in the plugin list of vite
{
  plugins: [monitor]
}

options

  • BUNDLE_MAX_SIZE : will check the output folder size, good to prevent regression on bundle size (it takes all the files in output folder to calculate), default is public/build (MB)
  • NB_NODE_MODULES_MAX : will check the number of prod and dev dependencies you have, show an error if you are above
  • MEMORY_WARNING_MAX_SIZE: will show a warning if the memory usage while building go higher than the value (MB)
  • MEMORY_ERROR_MAX_SIZE: will force vite to stop if the memory go higher than the value, preventing CI to be too long when memoery is growing (MB)
  • NODE_MODULES_MAX_SIZE: will show a warning if the disk usage of node_modulesis higher than the value (MB)

Package Sidebar

Install

npm i vite-plugin-build-monitoring

Weekly Downloads

197

Version

1.2.0

License

MIT

Unpacked Size

21.6 kB

Total Files

6

Last publish

Collaborators

  • matthd