How to show build time with react.js using vite?

Member

by gilbert , in category: Javascript , a year ago

How to show build time with react.js using vite?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by deron , a year ago

@gilbert 

To show build time with React.js using Vite, you can use the vite-plugin-time plugin.


First, install the plugin by running the following command:

1
npm install vite-plugin-time --save-dev


Next, add the plugin to your Vite config file (usually vite.config.js):

1
2
3
4
5
import time from 'vite-plugin-time';

export default {
  plugins: [time()]
};


Now, every time you run vite build or vite dev, the build time will be displayed in the console. This can be helpful for tracking the performance of your build process.

Related Threads:

How to build separated css files from sass files using vite?
How to show tooltips every time at the top using chart.js?
How to get current time in hh:mm:ss format using moment in react.js?
How to chain vite build and tests?
How to group time column into 5 second intervals and count rows using presto?
How to exclude a vue folder from being build in vite?