This readme was generated by GPT-4
This repository contains a Vite plugin designed to calculate and display the total bundle size of your project. It leverages the power of Vite's build system to provide you with insights into the size of your production build, helping you to keep your application's performance optimized.
- Calculates total bundle size after Vite build
- Displays bundle size in the console
- Helps in optimizing application performance
To install the plugin, run the following command in your project directory:
npm install vite-plugin-total-bundle-size --save-dev
or if you are using yarn
:
yarn add vite-plugin-total-bundle-size --dev
To use the plugin, import it into your vite.config.js
or vite.config.ts
file and add it to the plugins
array:
import totalBundleSize from 'vite-plugin-total-bundle-size';
export default {
plugins: [totalBundleSize()],
};
or with options:
import totalBundleSize from 'vite-plugin-total-bundle-size';
export default {
plugins: [
totalBundleSize({
fileNameRegex: /\.(js|css)$/,
printFileStats: true,
calculateGzip: false,
}),
],
};
Currently, the plugin does not require any configuration. It works out of the box once added to your Vite configuration.
-
chalk
: For colored console output.
To contribute to the development of this plugin, ensure you have the following tools installed:
- Node.js (version 12 or higher)
- npm/yarn
Clone the repository, install dependencies, and start making your changes:
git clone https://github.com/your-username/vite-plugin-total-bundle-size.git
cd vite-plugin-total-bundle-size
npm install
This project is licensed under the ISC License. See the LICENSE file for details.