Package Exports
- vite-plugin-total-bundle-size
- vite-plugin-total-bundle-size/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (vite-plugin-total-bundle-size) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Vite Plugin Total Bundle Size
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.
Features
- Calculates total bundle size after Vite build
- Displays bundle size in the console
- Helps in optimizing application performance
Installation
To install the plugin, run the following command in your project directory:
npm install vite-plugin-total-bundle-size --save-devor if you are using yarn:
yarn add vite-plugin-total-bundle-size --devUsage
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)$/,
}),
],
};Configuration
Currently, the plugin does not require any configuration. It works out of the box once added to your Vite configuration.
Dependencies
chalk: For colored console output.
Development
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 installLicense
This project is licensed under the ISC License. See the LICENSE file for details.